PHP COM("word.application")

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
be2k
Forum Newbie
Posts: 3
Joined: Tue Jan 30, 2007 4:32 pm

PHP COM("word.application")

Post 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??
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

be2k wrote:it takes 17 seconds. is it normal??
Normal... for word? likely.

Have you tried wordpad? Might be faster...
be2k
Forum Newbie
Posts: 3
Joined: Tue Jan 30, 2007 4:32 pm

Post 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...
_ca_
Forum Newbie
Posts: 12
Joined: Wed Oct 25, 2006 4:38 pm

Post by _ca_ »

Maybe you find something at http://www.microsoft.com/com/default.mspx?
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

Did you search properly? Here is something I found

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