RE: [PHP-WIN] Does COM require a particular dll?
| From: | Asendorf, John | Date: | Fri, 22 Dec 2000 18:58:34 +0000 |
| Subject: | RE: [PHP-WIN] Does COM require a particular dll? | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-4615@lists.php.net to get a copy of this message | ||
Sorry, getting lazy in my posts... sorry. I'm using php 4.0.4-dev as CGI on
NT4 with IIS4 and Word 9 (2000)
-----
The errors are:
Warning: Invoke() failed: No description available in
D:\serverroot\is\website\test_center\testCOM.php on line 31
Line 31 is: $word->Documents->Add();
Warning: Invoke() failed: Exception occurred. in
D:\serverroot\is\website\test_center\testCOM.php on line 40
Line 40 is: $word->Selection->TypeText("This is a test...");
------
I DO get this output though... (before the errors of course)
Loaded Word, version 9.0
Version using Com_get(): 9.0
------
Here's the code, it should be identical to the example minus the echo
comments...
#Instantiate the Word component.
$word = new COM("Word.Application") or die("Unable to instantiate Word");
#Get and print its version
print "Loaded Word, version {$word->Version}<BR>";
#Another way to get the version using com_get
$testversion = com_get($word->application,version);
print "Version using Com_get(): $testversion <BR>";
#Make it visible in a window
$word -> Visible = 1;
echo "Made Word visible<br />";
#Open a new document
$word->Documents->Add();
#Write something
$word->Selection->TypeText("This is a test...");
echo "typed text<br />";
#Now save the document
$word->Documents[1]->SaveAs("Useless.doc");
echo "Saved<br />";
#Comment next line if you want to see the word document,
#then close word manually
$word -> Quit();
echo "Should have quit word";
#Comment if you want to see the word document, then close
?>
---------------------
John Asendorf - jasendorf@lcounty.com
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
The benefit to the government of replacing all $1 Federal Reserve notes with
$1 coins would be $522.2 million per year, according to estimates of the
General Accouting Office released on April 7, 2000.
> -----Original Message-----
> From: Alain Samoun [mailto:alain@sonic.net]
> Sent: Friday, December 22, 2000 1:43 PM
> To: Asendorf, John; Php-Windows (E-mail)
> Subject: Re: [PHP-WIN] Does COM require a particular dll?
>
>
> John:
> Tell us how you know it's broken? what is the error message?
> Which windows are you using, which server?
> Alain
>
> On Fri, Dec 22, 2000 at 01:12:55PM -0500, Asendorf, John wrote:
> > I was working with the COM example by Alain from phpbuilder
> about a month
> > ago then moved to some other projects. The example worked
> well for me then.
> > Since then, we have had a vendor install their web enabling
> end of their
> > backend product and now the example is broken. I know they
> replaced some of
> > my OLE DLLs when they installed their product, but I don't
> know if PHP needs
> > or expects particular versions to work correctly.
> >
> > Anyone?
> >
> > ---------------------
> > John Asendorf - jasendorf@lcounty.com
> > Web Applications Developer
> > http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> > Licking County, Ohio, USA
> > 740-349-3631
> >
> > The benefit to the government of replacing all $1 Federal
> Reserve notes with
> > $1 coins would be $522.2 million per year, according to
> estimates of the
> > General Accouting Office released on April 7, 2000.
> >
> >
> > --
> > 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
>
> --
> 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
>