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!

open word document

Status
Not open for further replies.

scottydd

IS-IT--Management
Sep 19, 2002
31
0
0
US
Is it possible to use a ONLOAD to auto open a word document when a page is loaded? If so could someone tell me how?

Thanks,
Scott
 
Where abouts is the word document located... and how do you want it displayed to the user?

If it's on your server and you want it to be opened in a browser window:
Code:
window.open('/somepath/somefile.doc');
Would do the trick.

If you want to load a file from the user's system or explicitly in Microsoft word (not word in the browser) then it gets trickier and you'd need to be working in a tightly controlled (intranet) environment.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

AU.gif
Check out Tek-Tips Australia New Zealand forum1155
NZ.gif
 
Great, thanks...One more question, this makes it open in a new windows. How can i make it open in the current window?
 
try :

<body onload="document.location='c:\mydoc.doc'">

Although depending on how your browser is configured, this could open in the browser window / open in word etc, check your MIME type settings. If you use this on the web, then you are likely to have little / no control over how the data is presented to an end user - especially those without word ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top