in reply to Re: Re: Re: OLE print to a file
in thread OLE print to a file

Good morning again :)

The reason why I need to use fork, is that the OLE $Word->ActiveDocument->PrintOut ... doesn't return until the print-procedure is finished.
So it waits until the Save-to-file window is filled. but while the programm waits for the $Word->ActiveDocument->PrintOut ... procedure to return, it can't fill the Save-to-file window. So I need to implement a child process, which can do that specific job.

Cheers,
physi

----------------------------------- --the good, the bad and the physi-- -----------------------------------

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: OLE print to a file
by clemburg (Curate) on Jun 21, 2001 at 12:46 UTC

    To avoid the forking stuff, you could just call another script via system like this:

    #!/usr/bin/perl -w use strict; system('start perl -e "sleep 5; print qq(\007)"'); print "Before the beep ...\n";

    The important part here is the "start" thing. It starts your process and then returns to the shell spawning it immediately. Now you just have to wait a sensible amount of time (the "sleep" part above), and the do the sendkeys stuff (the "print" part above), and it should work, if the period to sleep is stable.

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com