This worked previously. I now have MS Office Pro Plus 2013, and this no longer works but instead gives a similar "no type library" message. If I dump the "use" and instead grab the constants from the document itself, I can load them:use Win32::OLE; use Win32::OLE::Const 'Microsoft.Word'; my $word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new( 'Word.Application', 'Quit' ); ... if ( !$selection->GoTo( wdGoToBookmark, 0, 0, $bookmark ) ) { $LOGGER->warn("Could not find bookmark $bookmark"); return; }
But then I have to wrap all of the constant with a more explicit call:use Win32::OLE; my $word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new( 'Word.Application', 'Quit' ); my $wd_const = Win32::OLE::Const->Load($word);
I'd prefer not to do that. Does anyone know how to get the use of Const to work?if ( !$selection->GoTo( $wd_const->{wdGoToBookmark}, 0, 0, $bo +okmark ) ) { $LOGGER->warn("Could not find bookmark $bookmark"); return; }
In reply to Re^3: "Type mismatch" Error While Using Win32:OLE for MS Outlook
by UtherSRG
in thread "Type mismatch" Error While Using Win32:OLE for MS Outlook
by dushyant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |