Red face Open MS Word with PHP - new COM("word.application") - HELP!
SPECS: windows XP, Apache 1.3, Mysql, PHP 5.0.5
Creating a php,mysql construct for a logistics firm.
PLEASE need some help in how to open up ms word thorugh php and then update a template saved in there and save it as a new file, and open this file up on the browser so that the user can then print the form.
Have been trying the COM approach:
// Create an object to use.
$word = new COM('word.application') or die('Unable to load Word');
but the web page remains blank on the localhost just loading .... then expires after time limit reached.
If anyone has successfully used the new COM() approach would really appreciate any help on how this is done, and what i could possibly be doing wrong.
Many Thanks
Thought i would post some of the code i have used to give a visual
<?php.....
// Some servers may have an auto timeout, so take as long as you want.
set_time_limit(0);
// Show all errors, warnings and notices whilst developing.
error_reporting(E_ALL);
// Used as a placeholder in certain COM functions where no parameter is required.
$empty = new VARIANT();
// Load the appropriate type library.
com_load_typelib('Word.Application');
// Create an object to use.
$word = new COM('word.application') or die('Unable to load Word');
print "Loaded Word, version {$word->Version}\n";
// Open a new document acting as template in word
$word->Documents->Open('C:/web/Sundance/Delivery Notes/Delivery_Template.doc');
........?>