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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link to word doc

Status
Not open for further replies.

mousematt

MIS
Feb 5, 2001
102
GB
Hi,

I'm trying to link to a word doc from a web page but instead of it opening in an IE window I would like it to open in word.

Anyone know how to do this or having the same prob?
 
No good, its for an intranet and the uses don't have zip.
 
I have a website on CD that contains Word, Excel and Powerpoint files that I wanted to be opened in the users own Office app, not IE.

I used some VBScript and an ActiveX Automation Control to do this. Because it used an ActiveX control, it requires the users browser to be configured to run ActiveX controls. This can be done through the Tools >> Internet Options >> Advanced menu or, as I did, I had a setup file which updated the registry to allow this ActiveX control to run.

Can provide more info if this sounds like what you need Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Or just display a simple message telling people to right click on the link to save the document. Might save a lot of work.


É ::
 
The code below (simplified here) was kept in an external .vbs file that was referenced from my HTML page.
Code:
Sub OpenWord(strFilename)
  Set objWord = CreateObject("Word.Application")
  objWord.Documents.Open(strFileName)
  objWord.Visible = True
End Sub

Sub OpenPPT(strFileName)
  Set objPPT = CreateObject("PowerPoint.Application")
  objPPT.Activate
  objPPT.Presentations.Open(strFileName)
  objPPT.Visible = True
End Sub

Sub OpenXL(strFileName)
  Set objXL = CreateObject("Excel.Application")
  objXL.Workbooks.Open(strFileName)
  objXL.Visible = True
End Sub
In my HTML page my links looked a bit like this:
Code:
<A onClick=&quot;Call OpenWord('autocontrols.doc')&quot;>Automatic Controls</A>

The setup file I wrote made the following additions to the registry to allow the ActiveX controls to run:

Word.Application
HKEY_CLASSES_ROOT\CLSID\{000209FF-0000-0000-C000-000000000046}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}
HKEY_CLASSES_ROOT\CLSID\{000209FF-0000-0000-C000-000000000046}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}

Excel.Application
HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}
HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}

PowerPoint.Application
HKEY_CLASSES_ROOT\CLSID\{91493441-5A91-11CF-8700-00AA0060263B}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}
HKEY_CLASSES_ROOT\CLSID\{91493441-5A91-11CF-8700-00AA0060263B}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4} Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Hi,

Do just want the word doc to open?

Just link to the doc.
<a href=&quot;yourdoc.doc&quot;>your doc</a>

And if it ask for a username and password you have to use an absolute link to the doc with a :mad: in front. For example

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top