Article ID: 178222 - View products that this article applies to.
This article was previously published under Q178222
The purpose of this document is to explain how to control the client-side behavior when a hyper-text link to a Word document is selected. For example, clicking on a link to a Word document usually defaults to opening the document from within Internet Explorer. You can change this behavior so that the link opens the file in Word.
This article applies to both a desktop user of Internet Explorer, as well as a Web author, writing client-side script. Although this article is tailored to MS Word, the concepts apply to other Microsoft document applications (that is, Excel).
The following two basic approaches to controlling the behavior will be discussed:
For the second approach, as a Web author you can control the behavior of a Word document through OLE Automation, provided the client is running Microsoft Word. Here are the basic steps:
NOTE For Word Automation to succeed, you must set your browser to Enable or to Prompt for Initialize and script ActiveX controls not marked as safe . If you set your browser to Disable, then the earlier sample code may produce a runtime error and may not work as expected.
For more information about Word automation, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/195826/ )CreateObject fails from client-side scripts
(https://support.microsoft.com/kb/198703/ )How to automating Excel from client-side VBScript
(https://support.microsoft.com/kb/286023/ )How to use a VB ActiveX component for Word automation from Internet Explorer
239470For additional information, visit the following Microsoft Developer Network Web site:
(https://support.microsoft.com/kb/239470/ )Cannot call GetObject from script in IE to access running object
Article ID: 178222 - Last Review: March 27, 2007 - Revision: 4.1
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.