Re: COM Functions
| From: | kill-9 | Date: | Wed, 03 Jan 2001 08:23:57 +0000 |
| Subject: | Re: COM Functions | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4754@lists.php.net to get a copy of this message | ||
try giving it a path to save to.
$word->Documents[1]->SaveAs("c:\inetpub\wwwroot\Useless test.doc");
Watch out every time it crashes you have a WinWord.exe hanging in the
background of your pc that you cant see. Make sure word is NOT open.
When it does work. You wont see word start. Just look in the directory and
it will be sitting there .
kill-9
www.kill-9.dk for all your php and mysql needs
----- Original Message -----
From: "IThelp" <IThelp@americanbridge.net>
To: <php-windows@lists.php.net>
Sent: Tuesday, January 02, 2001 3:09 PM
Subject: [PHP-WIN] COM Functions
> I am trying to figure out how to use the COM functions in PHP. I tried
the
> following code for a test.
>
> <?
> $word = new COM("word.application") or die("Unable to instanciate Word");
> print "Loaded Word, version {$word->Version}\n";
> $word->Visible = 1;
> $word->Documents->Add();
> $word->Selection->TypeText("This is a test...");
> $word->Documents[1]->SaveAs("Useless test.doc");
> $word->Quit();
> ?>
>
> I got the following errors when the above code is ran.
>
> Warning: Invoke() failed: No description available in
> c:\inetpub\wwwroot\test.php on line 5
>
> Warning: Invoke() failed: Exception occurred. in
c:\inetpub\wwwroot\test.php
> on line 7
>
> Ryan
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>