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! Quote Link to comment Share on other sites More sharing options...
WillyTheFish Posted July 29, 2010 Author Share Posted July 29, 2010 anyone... please? =( Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.