NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP & Word Documents

Sajith A sajith.ml at gmail.com
Mon May 9 04:44:03 EDT 2005


On 5/8/05, Joseph Crawford <codebowl at gmail.com> wrote:
>Is there a way to parse a word document?

Months back i came across a document management system which does this 
http://dms.markuswestphal.de/ 
It basically uses exec command.

On a windows server it uses 
cscript convert.word.js {SOURCE} {TARGET}

where the contents of convert.word.js is 
----------------------------------------------------------------------------------------------------------------------------
var source = WScript.Arguments(0);
var target = WScript.Arguments(1);

var WordApp;
WordApp = new ActiveXObject("Word.Application");
var Newdoc;
Newdoc = WordApp.Documents.Open(source);
Newdoc.SaveAs(target, 8); // wdFormatHTML = 8
WordApp.Quit();
----------------------------------------------------------------------------------------------------------------------------

On a Linux server it uses 
mswordview -o {TARGET} {SOURCE}

There could be better ways for doing it. Would love to hear if any...

Regards
Sajith A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20050509/6a0ed8dc/attachment.html>


More information about the talk mailing list