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

open a word document ?? 1

Status
Not open for further replies.

fb18

Programmer
Mar 4, 2005
14
GB
Im pretty new to perl so go easy on me... Im using perl version 5.004_05 and basically i want to open a word document when a user clicks a link in the browser. Having done some research it seems the way to do this is to use the Win32 module, however I dont have this. So is there another way I can open a word document in the version of perl im using? thanks

The word document I want to open is stored on the client, at the moment on the c drive. I have a perl script which runs and populates a (html) table with data, one of the columns has a link in it to the word document. so far I havent figured out how to actually open the doc from the link. Ive tried to create a link with a path to the file but all i get is a blank explorer window when i click the link. Is this something to do with setting the MIME type for a .doc extension? Id prefer it if when the link was clicked ms word application was launched rather than actually displaying it in the browser.

 
Is your Perl script running on the Client's machine, or a web site controlled elsewhere?

- Rieekan
 
Its running on a web site.
 
OK, assuming the file is located in the same place on everyone's computer, this is possible, but it would not be a Perl solution. You can create the link to match the one below to have a browser open the file on the user's computer. Whether or not is spawns Word as a separate application may still be an issue, but this will get you closer to your solution.

Code:
<a href="file:///c:/documents and settings/walterg2/my documents/documents/ips_401k_standard.doc">

- Rieekan
 
Thanks for that, it was one of the things I already tried, when i use that piece of code all I get is a blank explorer window when the link is clicked.

I think im going to try using some javascript to get it to work.At the moment I can get the javascript code to open word but not the actual file and also it causes an error on my page.

Do you know how I can do it in javascript?

 
No, I'm pretty rusty with Javascript. Too many years programming server side. Put up your question in the JavaScript forum and they'll be able to help you with this. Just be sure to include code as well so they know where you're at.

- Rieekan
 
Actually that piece of code did work, it always helps if you have the right file path! Oh dear :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top