Page 1 of 1

PHP COM("word.application")

Posted: Tue Jan 30, 2007 6:56 pm
by be2k
Hello

I've found few topics here about opening, modifying, creating etc. .doc files using PHP.
Do you have any documentation about methods of COM("word.application") object, like:

Code: Select all

docHandle->Documents[1]->Activate();
docHandle->ActiveDocument->Select();
//etc...
??
I need to get number of pages of .doc file and open only specified page nr, not the whole .doc file.
I've search internet and didn't find anything about how to do this in PHP.
I've found how to get number of pages using VBA, and it's something like that:
Solution #1:
Selection.Information(NumberOfPagesInDocument)
Solution #2:
ActiveDocument.BuiltInDocumentProperties("Number of Pages")
Solution #3:
ActiveDocument.Content.ComputeStatistics(wdStatisticPages)
but i couldn't implement this in php.

Another question, when i make new COM object:

Code: Select all

$handler = new COM("Word.Application") or die("Unable to instanciate Word");
it takes 17 seconds. is it normal??

Posted: Tue Jan 30, 2007 7:31 pm
by Kieran Huggins
be2k wrote:it takes 17 seconds. is it normal??
Normal... for word? likely.

Have you tried wordpad? Might be faster...

Posted: Wed Jan 31, 2007 1:45 am
by be2k
Kieran Huggins wrote: Normal... for word? likely.

Have you tried wordpad? Might be faster...
and how to instanciate wordpad?

Code: Select all

new COM("WordPad.Application")
gives Apache Error...

Posted: Wed Jan 31, 2007 3:46 am
by _ca_
Maybe you find something at http://www.microsoft.com/com/default.mspx?

Posted: Wed Jan 31, 2007 4:10 am
by dude81
Did you search properly? Here is something I found

http://sourceforge.net/project/showfile ... p_id=38257