Word COM objects
Posted: Mon Feb 16, 2004 12:27 pm
Hello, on Friday I posted a question about how to dynamically create word documents using PHP. I have figured out how to open a new word com object and have been able to successfully create my dynamic word documents that way. However, it is very slow as it is opening a new instance of word on the server every time I want to create a new document. What I would like to be able to do is connect to an existing open object and use it to create my documents so that I'm not having to open a new instance of word every time I want to create a new document. I know this can be done because I do it with .asp and .cfm but I can't seem to find any documentation for php on how to do this. I'm amenable to invoking a new instance just for php and connecting to that one (thereby having two instances of word open on the server at any one time). But I cant' seem to figure this out. Ideally, I'd like to use the same instance that I have open for .cfm and .asp.
I've tried:
$objWord = com_load("Word.Application");
$objWord = new COM("Word.Application");
but as I said above, both of those invoke new instances of the word application on the server which causes a significant amount of load time.
does anyone know a way to call the already open instance?
thx,
Burr
I've tried:
$objWord = com_load("Word.Application");
$objWord = new COM("Word.Application");
but as I said above, both of those invoke new instances of the word application on the server which causes a significant amount of load time.
does anyone know a way to call the already open instance?
thx,
Burr