RE: [PHP] runing com
| From: | Michael Hazelden | Date: | Wed, 13 Nov 2002 23:12:53 +0000 |
| Subject: | RE: [PHP] runing com | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-124341@lists.php.net to get a copy of this message | ||
I've been having some fun with COM myself recently ... so I can suggest a
couple of things ...
Firstly - that error would suggest to me that Word is not installed on your
machine. Remember - in order to interface with an app - it has to be there.
If it is ... try looking it up in the registry to confirm the registration
for COM exists.
Second ... why do you want to run media player to play a wave file on the
server? I would have thought you'd want to activate the script on the client
...
Another good idea is to check over the event viewer on the server - there
are sometime some very revealing errors in there.
Cheers,
Michael.
-----Original Message-----
From: kai [mailto:kai_flash@hotmail.com]
Sent: 14 November 2002 07:20
To: php-general@lists.php.net
Subject: [PHP] runing com
hi guy's I have a problem running com+ code and would appreciate any help.
What I like to do is have the mediaplayer run a wave file triggert from php
via com.
but I can not run any example code from the help without errors.
this code is from a the help and should work but doesn't on my mashine:
// starting word
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";
file://bring it to front
$word->Visible = 1;
file://open an empty document
$word->Documents->Add();
file://do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
file://closing word
$word->Quit();
file://free the object
$word->Release();
$word = null;
This is all very basic code and should run.
I do not have word so I tried with other apps. like wordpad or painbrush
but allways recieve this error:
Warning: Invalid ProgID, GUID string, or Moniker: Invalid syntax in
D:\Apache\htdocs\ring.php on line 7
Unable to instanciate ..........
Now I tried to give the access right's on the particular apps in dcomcnfg
and
also edited php.ini to
allow Distributed-COM calls
com.allow_dcom = true
Does anybody can give me a run down on what I have to do exactly to get this
code running for
let's say wordpad.
Thank you
KAi
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Control Centre.
This message has been checked for all known viruses by the MessageLabs Virus Control Centre.
*********************************************************************
Notice: This email is confidential and may contain copyright material of Ocado Limited (the
"Company"). Opinions and views expressed in this message may not necessarily reflect the
opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all copies of this
message. Please note that it is your responsibility to scan this message for viruses.
Company reg. no. 3875000. Swallowdale Lane, Hemel Hempstead HP2 7PY
*********************************************************************