[EMAIL PROTECTED] wrote:
>
> Using Win95b, Word 97 sp2, AS Perl 5.005_03
>
> Ok, I modified my suggestion below to work with Word. It works; however,
> if it starts a new instance of Word, the script will not exit until that
> instance is terminated. (Note that script statements after the invocation
> of Word appear to execute in parallel, but the script's process will not
> terminate until that instance of Word is killed.) This differs from Excel,
> where the instance will live on without locking up the script's process.
> Further, if Word already has an instance, the script will exit; however,
> the $word->{Visible} = -1; assignment will not leave the instance's Window
> on top after exit. Again, this differs from Excel. Anyone have
> explanations on these points?
>
> Guess I need to get one of David Roth's books.
>
> Here's the transmogrified code:
>
> #!c:/perl/bin/perl
>
> # Reference existing Word instance or start a new one. Die on failure of both
>attempts.
> use Win32::OLE qw(in with);
> use Win32::OLE::Const 'Microsoft Word';
> $Win32::OLE::Warn = 3; # die on errors...
> my $word = Win32::OLE->GetActiveObject('Word.Application')
> || Win32::OLE->new('Word.Application'); # get already active
>Word
> # application or
>open new
> # Make the Word session visible.
> $word->{Visible} = -1;
>
I am using
win 98
perl 5.6.0
and running from the command line the script always exits.
What OS/perl are you using? How are you running it?
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users