Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2007, 01:34 AM
jaiprakash
Guest
 
Posts: n/a
Default how can read MS-Word document

Hi buddies,

I'm here want to put a php query, i.e i want to read a Microsoft word document using php and display at the html page. i was try the following code but couldn't find satisfactory response :

<?php
// starting word
$word = new COM("word.application") or die("Unable to instantiate Word");
print "Loaded Word, version {$word->Version}\n";

//bring it to front
$word->Visible = 1;

//open an empty document
$word->Documents->Add();

//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");

//closing word
$word->Quit();

//free the object
$word->Release();
$word = null;
?>
I have got the error:
Fatal error: Uncaught exception 'com_exception' with message 'Error [0x80020003] Member not found' in C:\Program Files\xampp\htdocs\test\read_word1.php:20 Stack trace: #0 C:\Program Files\xampp\htdocs\test\read_word1.php(20): com->Release() #1 {main} thrown in C:\Program Files\xampp\htdocs\test\read_word1.php on line 20.
I'm using php 5.1.6 with xampp at windows environment.
Please, give he some help.

jaiprakash kumar





Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening word document read only in VB StevenVints VB How-To 1 May 3rd, 2006 09:52 AM
Reading MS WORD Document by VB.Net ocarroll General .NET 0 March 31st, 2006 02:17 AM
insert word document to DB an read webphp PHP How-To 1 August 10th, 2005 02:34 PM
Opening a MS Word document from ASP saturdave Classic ASP Basics 0 May 25th, 2004 01:47 PM
How to open word document using ASP and read ksaleemkhan Classic ASP Components 3 April 28th, 2004 04:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.