Re: COM and Word, how?
| From: | Dallas Thunder | Date: | Tue, 03 Sep 2002 01:16:58 +0000 |
| Subject: | Re: COM and Word, how? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-15644@lists.php.net to get a copy of this message | ||
Well, this script works fine on my machine. Windows XP w/ Office XP, PHP
4.2.3.
"Michelle" <michelledebeer@yahoo.com> wrote in message
news:20020902171132.91711.qmail@pb1.pair.com...
> I am new to COM and tried an example today (See bottom of post)
>
> When I execute the code, I get is an error message and if I look in the
Task
> Manager, there is a WINWORD.EXE process running, which I can't end. Every
> time I reload the page, a new winword is started...
>
> How should PHP.ini be set for me to use COM Objects?
>
> ---------------------------------
> Error message:
> Warning: Unable to obtain IDispatch interface for CLSID
> {000209FF-0000-0000-C000-000000000046}: The message filter indicated that
> the application is busy. in d:\inetpub\wwwroot\incmill\ver2\readfile.php
on
> line 2
> Unable to instantiate word
>
> Setup:
> Windows 2000 Professional
> PHP 4.2.1
> Office 2000
>
> PHP.ini
> COM values:
> Directive, Local Value, Master Value
> com.allow_dcom, Off, Off
> com.autoregister_casesensitive, On, On
> com.autoregister_typelib, Off, Off
> com.autoregister_verbose, Off, Off
> com.typelib_file, no value, no value
>
>
> Code:
> $word = new COM("word.application") or die("Unable to instantiate Word");
> print "Loaded Word, version {$word->Version}<BR>";
> $word->Visible = 1;
> $word->Documents->Add();
> $word->Selection->TypeText("This is a test...");
> $word->Documents[1]->SaveAs("Useless test.doc");
> $word->Quit();
>
>
>
>