in reply to Win32::OLE problem with Destructing
$Doc->Activate(); $Doc->SaveAs ('F:\\dev\\experiment\\ScanWord\\foobar.doc');
You need to have an "Active Document" for it to work. You might also have to instantiate an object pointing at word specifically to use
$Word->ActiveDocument->SaveAs()
C-.use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; $Win32::OLE::Warn = 2; # Throw Errors, I'll catch them my $Word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new('Word.Application', 'Quit'); my $Doc = Win32::OLE->GetObject($wrdfile) || die &CheckError(); #### or #### my $Doc = $Word->Documents->Open($wrdfile) || die &CheckError();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Win32::OLE problem with Destructing
by John M. Dlugosz (Monsignor) on Jul 21, 2001 at 00:52 UTC | |
by cacharbe (Curate) on Jul 23, 2001 at 19:16 UTC |