Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Word Document from ASP

Status
Not open for further replies.

rap43

Programmer
Apr 21, 2003
13
0
0
US
I would like to present within the IE browser a link to a MS Word document that the user can hyperlink to and have the word document open in its own MS Word Window. What kind of code would this take?

Everyone does have .doc assigned as a MS word app on their pc's

Thanks.
 
Dear rap43, I hardly feel qualified to answer since I consider myself a "newbie" (I was looking on the forum to see if a question I posted had been answered yet.) I have had some experience though with what you are asking, and it may be of help to you. On the page that I am working on the documents that we are linking to are by and large Word documents that we have converted to .htm documents using Words "save as" feature. The reason we had our users learn to change them to .htm docs was because originally we just left them as Word docs, but when they were opened via the hyperlink, we found they could be edited just as if they were in Word itself. We did not want this for our application -- only the users creating the docs should be able to edit them, not anyone else. But for your application, it may be just the thing. We linked to them using a physical path, not a virtual one.
 
Just my 2 cents...

If you set the Word.doc document's properties to "Read Only" you shouldn't be afraid of modifying it by other users.

That at least what I was doing and it worked just fine.

-Tivoli0
 
For Tivoli0,
Yes, good idea. We would go with that if the persons posting the documents were comfortable with computers. Most of them are not -- training them to save their doc to a file other than their default file was almost more than many could handle, so we kept it to as few steps as possible. Knowing about the option you suggested is good though, because it may be the perfect solution in a different situation. You don't happen to have any ideas on how to solve my file system object problem, do you? (It was posted on 3/5 and I don't have any replies yet) I really need the input of someone with both security and asp experience. Thanks!
 
If you create a SHORTCUT to the word-doc, then create a link to the SHORTCUT, then the user will get an "Open or Save" dialog. If they OPEN, then it will open in MS-WORD... every time.

Of course, if they SAVE, it'll save the SHORTCUT, not the word-doc.

This is the method I use.

Note: When you create a shortcut, the file extension is always hidden. Your shortcut name will look like "shortcut to word.doc"... well, your LINK needs to use the correct extension... so set up your anchor-tags like:

<a href=&quot;shortcut to word.doc.lnk&quot;>Word.doc</a>

... the shortcut's extension is ALWAYS &quot;.lnk&quot;... but it's kinda hard to find that our just by looking at it.

Again, Linking to a SHORTCUT will always open the document in it's native application.

Good luck with your project.
 
If you create a SHORTCUT to the word-doc, then create a link to the SHORTCUT, then the user will get an &quot;Open or Save&quot; dialog. If they OPEN, then it will open in MS-WORD... every time.

Of course, if they SAVE, it'll save the SHORTCUT, not the word-doc.

This is the method I use.

Note: When you create a shortcut, the file extension is always hidden. Your shortcut name will look like &quot;shortcut to word.doc&quot;... well, your LINK needs to use the correct extension... so set up your anchor-tags like:

<a href=&quot;shortcut to word.doc.lnk&quot;>Word.doc</a>

... the shortcut's extension is ALWAYS &quot;.lnk&quot;... but it's kinda hard to find that out just by looking at it.

Again, Linking to a SHORTCUT will always open the document in it's native application.

Good luck with your project.
 
Also, for things like Expense Reports and such, we have a standard Excel spreadsheet, which is saved as a TEMPLATE file (Expense.xlt), then linked to our intranet via a SHORTCUT file... so, when users click the link, they get a new, fresh copy of the blank Expense Report to fill out... and when they SAVE, it defaults to their own &quot;My Documents&quot; folder.

So, SHORTCUTS and TEMPLATES... a good combo (IMHO)
 
Mr3Putt - Thank You! Creating the shortcuts worked like a charm!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top