Re: load word document with php
| From: | Richard Davey | Date: | Tue, 30 Nov 2004 14:07:24 +0000 |
| Subject: | Re: load word document with php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203144@lists.php.net to get a copy of this message | ||
Hello Thomas,
Tuesday, November 30, 2004, 1:35:10 PM, you wrote:
TF> <?php
TF> $word=new COM("word.application") or die("Cannot start word for you");
TF> $word->visible = 1 ;
TF> $word->Documents->Open("Test.doc");
TF> $word->Selection->TypeText("Hello World");
TF> $word->Documents[1]->SaveAs("New Test.doc");
TF> $word->ActiveDocument->Close(false);
TF> $word->Quit(false);
TF> $word->Release();
TF> $word = null;
?>>
TF> No error occurs and the new word Document is saved with the changes, but i
TF> don't see the document within the webbrowser.
Redirect to the newly modified .doc file (or do a file passthru -
whatever, just send it to the browser somehow) and then of course pray
to the browser Gods that the end users browser has been configured to
display Word files rather than save them (read: will only work in IE,
if at all).
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde