RE: Re: Doing Wordcount in PHP of files like DOC, RTF, TXT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Failed to create COM object `word.application'

This is your problem, but I'm not sure why. This page might help to find the
answer :-
http://uk.php.net/manual/en/ref.com.php

Alternatively, try running the script with only this line in :-
<?php $word = new COM("word.application") or die("Cannot start word for
you"); ?>

Rob.


-----Original Message-----
From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On
Behalf Of tvkswamy
Sent: 26 March 2007 16:24
To: php-objects@xxxxxxxxxxxxxxx
Subject:  Re: Doing Wordcount in PHP of files like DOC, RTF, TXT

Hi Robert,

I am my thirst is still not quenched. I keep getting the following
error:

Fatal error:  Uncaught exception 'com_exception' with message 'Failed to
create COM object `word.application': Server execution failed ' in
C:\web\xampp\htdocs\wordcount\index.php:2 Stack trace: #0
C:\web\xampp\htdocs\wordcount\index.php(2):
com->com('word.applicatio...') #1 {main}   thrown in
C:\web\xampp\htdocs\wordcount\index.php on line 2

My code is :
<?php
$word = new COM("word.application") or die("Cannot start word for you");
$word->visible = 1; $word->Documents->Open("c:\df.doc");
print "There are " .
$word->ActiveDocument->BuiltInDocumentProperties("Number Of Words") . "
words in the document<br> \n";
print "There are " . $word->ActiveDocument->BuiltInDocumentProperties(
"Number Of Paragraphs") . " paragraphs in the document<br> \n"; print "There
are " . $word->ActiveDocument->BuiltInDocumentProperties(
"Number Of Characters") . " characters in the document<br> \n";
$word->Quit(); ?>

What does this mean?

Regards,
tvks

***********************************************************************************
Any opinions expressed in email are those of the individual and not necessarily those of the company. This email and any files transmitted with it are confidential and solely for the use of the intended recipient 
or entity to who they are addressed. It may contain material protected by attorney-client privilege. If you are not the intended recipient, or a person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited.

Random House Group + 44 (0) 20 7840 8400
http://www.randomhouse.co.uk
http://www.booksattransworld.co.uk 
http://www.kidsatrandomhouse.co.uk
Generic email address - enquiries@xxxxxxxxxxxxxxxxx

Name & Registered Office:
THE RANDOM HOUSE GROUP LIMITED
20 VAUXHALL BRIDGE ROAD
LONDON
SW1V 2SA
Random House Group Ltd is registered in the United Kingdom with company No. 00954009, VAT number 102838980
***********************************************************************************


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux