WillyTheFish Posted July 29, 2010 Share Posted July 29, 2010 Hey guys, I've been searching the forum, but haven't found a post describing the following problem: I want to Open and Manipulate a word document using the COM class. This is my code so far: $Wrd = new COM("Word.Application"); $DocName = TEMPLATE_DIR.'template.doc'; $Wrd->Application->Visible = True; $WrdDoc = $Wrd->Documents->Open(realpath($DocName)); # do something here $WrdDoc->SaveAs(realpath($DocName)); $Wrd->ActiveDocument->Close(false); $Wrd->Quit(); $Wrd = NULL; There's no problem creating the COM-object, but when i try $WrdDoc = $Wrd->Documents->Open(realpath($DocName)); the browser is either complaining about insufficient memory or will chew on the code for ages... I can see that a temporary word file is created, so it seems that the document has been opened... still, the browser is working and working.... can anyone tell me what's going on? Many Thanks! Link to comment https://forums.phpfreaks.com/topic/209229-problem-with-opening-doc-with-php-using-com/ Share on other sites More sharing options...
WillyTheFish Posted July 29, 2010 Author Share Posted July 29, 2010 anyone... please? =( Link to comment https://forums.phpfreaks.com/topic/209229-problem-with-opening-doc-with-php-using-com/#findComment-1092653 Share on other sites More sharing options...
WillyTheFish Posted July 29, 2010 Author Share Posted July 29, 2010 yeah it's me again.... now I downloaded and tried this script/class and left it unchanged... still doesn't work: http://www.phpclasses.org/package/3553-PHP-Edit-Microsoft-Word-documents-using-COM-objects.html there must be something wrong with my php-settings or my ms Word installation i guess? COM is enabled in phpinfo()! Any suggestions....? I really need to get this to work thanks! Link to comment https://forums.phpfreaks.com/topic/209229-problem-with-opening-doc-with-php-using-com/#findComment-1092658 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.