
October 17th, 2002, 12:40 PM
|
|
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
COM Functionality...
Trying to get a COM function to open word, type a few words n save it again... simple you would have thought... look at this script.
php Code:
Original
- php Code |
|
|
|
<?php $word = new COM("word.application") or die("Impossible to instantiate WordApp"); print "Word is running, version {$word->Version}n</br>"; $word->Visible=1; $word->Documents->Add(); $word->Selection->TypeText("This is a test..."); $word->Documents[1]->SaveAs("test_com_php.doc"); $word->Quit(); ?>
Should work with no problems... BUT I get this :-
Code:
Warning: Type library value emptyenum is already defined and has a different value in c:Inetpubwwwrootcom.php on line 2
Word is running, version 9.0
Warning: Invoke() failed: Exception occurred. Source: Microsoft Word Description: Could not open macro storage. in c:Inetpubwwwrootcom.php on line 9
Warning: Invoke() failed: Exception occurred. Source: Microsoft Word Description: The requested member of the collection does not exist. in c:Inetpubwwwrootcom.php on line 10
And it also leaves the WinWord process started and unfinished on the server, unable to quit this.
Any help/thoughts would be appreciated.
|