I'm trying to use php replace texts in msword doc. Using COM. throws Error [0x80020011] Does not support a collection. code is copy and modified from VBA. $word = new COM("Word.Application") or die("Word not installed!"); try{ $word->Documents->Open("c:\1.doc"); $word->ActiveDocument->Range->Find->Text="222"; $word->ActiveDocument->Range->Find->Replacement->Text="111"; $word->ActiveDocument->Range->Find->Forward=True; //$word->ActiveDocument->Range->Find->Replace=2; //$word->ActiveDocument->Range->Find->Wrap=1; $word->ActiveDocument->Range->Find->Format=False; $word->ActiveDocument->Range->Find->MatchCase=False; $word->ActiveDocument->Range->Find->MatchWholeWord=False; $word->ActiveDocument->Range->Find->MatchWildcards=False; $word->ActiveDocument->Range->Find->MatchSoundsLike=False; $word->ActiveDocument->Range->Find->MatchAllWordForms=False; $word->ActiveDocument->Range->Find->Execute(); $word->ActiveDocument->SaveAs("c:\2.doc"); [...] read more
I have trouble using perl (strawberry) and win32::ole using powerpoint (from office2010) to convert ppt(x) to pdf. I can export to jpgs fine with Export function but the function ExportAsFixedFormat has a quite obscure syntax and alwawys gives me Win32::OLE(0.1709) error 0x80020011: "Does not support a collection". this is a [...] read more
I'm trying to merge two document into new doc file but I'm getting error in following code. use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; $meta_file_path = "D:\\copyfrom.doc"; $main_file_path = "D:\\copyto.doc"; my $x = Win32::OLE->GetActiveObject('Word.Application') ; my $word = Win32::OLE->new('Word.Application', sub { $_[0]->Quit; } ); my $doc = $word->Documents->open($meta_file_path) or [...] read more