...

View Full Version : Opening Word thourg 'href' link



bostjank
07-15-2002, 12:42 AM
Hi!

I have a link that opens Word document

<a href="document.doc" target="_blank">Open document</a>

Of course, the document opens in IExplorer window. But there is a problem - the document I'm trying to open contains AutoOpen macro that starts whenever the document is opened. When I open the document through IExplorer, I get this error:

Run-time error: '4605':
This method or property is not valid because: this document is in other application.


So - how can I open the document in Word window?

Thanks,
Bostjan

andrewsheldon98
07-15-2002, 03:32 AM
its basically impossible to do because every href is defined to be opened in a IE window

justame
07-15-2002, 03:41 AM
bos...
just a checkout® this link...
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q162059

seems by just a default®??? ie isss set to just a open® office programs...
sooo ifin' you dont want to just a change® your 'settings' orrr just a sk® your viewers tooo???
bestest to just a zip® the file...:O)))

webmarkart
07-16-2002, 07:01 AM
using asp I've opened dynamically generated tables in excel... I'm not sure if will work with word, but its worth a try... If your familiar with asp let me know and I'll give you the code.

bostjank
07-16-2002, 08:54 AM
Hi!

All my pages are actually created in ASP so it would be great if you could give me the code.


Thanks.

webmarkart
07-16-2002, 07:31 PM
Here is what I did for excel, so try playing around with the application name (perhaps application/vnd.ms-word) to get it to work with word...


--------PUT THIS ON THE VERY TOP OF YOUR ASP PAGE---------
<%
action = Trim(Request("action"))

If action = "msexcel" Then
Response.ContentType = "application/vnd.ms-excel"
End If
%>


-------THIS IS THE LINK TO THE DOC----------------
<A HREF="yourpage.asp?action=msexcel">View Word Doc</A>


The action="msexcel" was a plain html table with the rows being looped for all of the records in the database. I'm guessing that if you put the text in a plain html table as you would want it formated it would open in word.... I have never tried it in word so this may not work.

lwsuther
02-14-2006, 08:53 PM
bos...
just a checkout® this link...
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q162059

seems by just a default®??? ie isss set to just a open® office programs...
sooo ifin' you dont want to just a change® your 'settings' orrr just a sk® your viewers tooo???
bestest to just a zip® the file...:O)))


This is just what i was looking for. Gives users ability to email formated Word doc. good link



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum