PHP & COM
| From: | sean fell | Date: | Mon, 20 Nov 2000 08:07:47 +0000 |
| Subject: | PHP & COM | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26208@lists.php.net to get a copy of this message | ||
I'm having a problem using COM and PHP4 on the Windows NT Platform.
I don't think its an actual problem with PHP itself but here goes.
Basically the clients upload documents to the server. I use PHP file uploading to do this. I then spawn Word to print out this document on the Server. Here is where i get my problem.
The code i'm using is similar to that listed below
$word =new COM("word.application") or die("Unable to instantiate word");
print "Loaded word version($word->Version)\n";
$word->visible =1 ;
$word->Documents->Open("$pfile");
$word->ActiveDocument->PrintOut();
$word->Quit();
This all works fine except it appears that the
$word->ActiveDocument->PrintOut();
would seem to be returning before the document has actually been spooled for printing. When the $word->Quit(); is run Word on the server
throws up a dialog box asking if i want to abort the printing of the
current document. I'm assuming that Word must be threading the printing
hence the $word->ActiveDocument->PrintOut(); statement returning virtually straight away.
I'm so near, yet frustratingly so far. Can anybody help ?
Thanks in advance
Sean
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at http://profiles.msn.com.