Jump to content

epezhman

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

epezhman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks for mentioning that but didn't working neither. I put the file in project folder so I guess that wouldn't be a problem.
  2. thanks for the reply .I tried it but it didn't work. I think it could't open the .doc file at all. when I write echo count($word->Documents); it just print 1, which means It doesn't open the doc file. I guess that create the COM application but can't open the the file. I tried it with different version of MS word and even windows OS but the same result. any more ideas? thanks
  3. I use word 2007 and save it as .doc version, is there anything wrong with it?
  4. Hi, I'm trying to read MS word docs by php but no result so far. I've been using COM applications to open a word doc but not working properly for me, so I thought it would be cool to convert word doc to the HTML and read those, do you have any Idea if it's possible? thanks
  5. I'm trying to process MS words doc in PHP. I found some samples which use COM applications for this but not working properly (I get only exceptions and no result) and I taught it's the version of word on my localhost or my OS so I tried them on with different windows OS and MS word. but same result, since it would be harder to make it work on remote server (the remote server needs to have MS word installed on) so I'm looking for different approach, what you think?? is there nay good one rather than COM applications? have you ever tried? is it possible to write code with other like ASP or java and combine it with PHP? every little piece of advice would be appropriated, thanks
  6. does it mean I don't have the word.application COM?
  7. here it is : exception 'com_exception' with message 'Source: Microsoft Word Description: The requested member of the collection does not exist.' in C:\wamp\www\PhpProject1\index.php:29 Stack trace: #0 C:\wamp\www\PhpProject1\index.php(29): unknown() #1 {main} these line I guess : $word->Documents[1]->SaveAs($TXTfilename ,2); $word->Documents[1]->Close(false);
  8. Hi, I'm trying to read a MS word doc, I found these code on a blog which uses COM , but when I run this PHP code I get an exception : " com_exception Object ( [message:protected] => Source: Microsoft Word Description: The requested member of the collection does not exist. [string:Exception:private] => [code:protected] => -2147352567 [file:protected] => C:\wamp\www\PhpProject1\index.php [line:protected] => 31 [trace:Exception:private] => Array ( [0] => Array ( [file] => C:\wamp\www\PhpProject1\index.php [line] => 31 [function] => unknown ) ) [previous:Exception:private] => ) " here is the code $filename="cv.doc"; $TXTfilename = $filename . ".txt"; $word = new COM("word.application") or die("Unable to instantiate Word object"); $word->Documents->Open($filename); // the '2' parameter specifies saving in txt format $word->Documents[1]->SaveAs($TXTfilename ,2); $word->Documents[1]->Close(false); $word->Quit(); $word->Release(); $word = NULL; unset($word); $content = file_get_contents($TXTfilename); unlink($TXTfilename); I read from here " http://ir2.php.net/manual/en/com.installation.php " that I don't need to install COM but I need to install some COM objects like for MS word doc, but I don't know how to fix it, any idea? thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.