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

How to open a word document, write data to it, and save it using Javas

Status
Not open for further replies.

oldisgold

Programmer
Apr 14, 2005
1
SE
Hi,

Using Javascript, i need to open a word document, write some data and save the word document.
Is there any way to do this task.

Kindly help.
 
Javascript doesn't allow reading or writing of files on either server or client machines( abridged quote from page6 'visual quickstart guide: Javascript for the world wide web by T Negrino and D Smith, peachpit press), so I would be surprised if you can do this in Javascript. This is mainly due to security issues.

To do this you would need to use a server-side script, (python, perl etc.), use PHP, ASP.NET, Java or use ActiveX controls that are downloaded. You may still have issues with these if the client is using XP SP2 or something similar.

Sorry, I can't help any more than this

 

You can read and write files on the browser using the FileSystemObject ActiveX control... but this works on IE only, and then only if you have allowed ActiveX to run.

However, I would not use this for amending Word documents, as they are a proprietary binary format, and you will most likely (unintentionally) break something. You might try using one of the Word ActiveX objects to see if you can edit and save your document that way (much like Greg's Excel link above).

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top