On first execution (listed below), the "Now starting Word" message is
printed, and according to Task Manager, Winword.exe starts, but it is not
visible. On second execution, Word becomes visible and everything seems
OK.
If Word is already active, this script works OK on the first try.
What's wrong?
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Word';
my $classid = 'Word.Application';
my $word = Win32::OLE->GetActiveObject( $classid );
if ( ! $word )
{
print "No WORD app is active. Now starting Word...\n";
my($word) = Win32::OLE -> new($classid) || die 'Could not start Word';
my($doc) = $word -> Documents -> Add() || die 'New Document option
failed';
}
#
$word -> {Visible} = 1;
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]