Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Perl+MSWord (via Win32::OLE) events handling

by t0mas (Priest)
on Sep 26, 2002 at 13:50 UTC ( [id://200879]=note: print w/replies, xml ) Need Help??


in reply to Perl+MSWord (via Win32::OLE) events handling

Do you by asking:
Does anyone knows a way how to send to my program any type of signal in my case?
mean that you want to send a message to Word, that gets processed by the message loop in your perl program?

If so, you could try:
#!/usr/bin/perl -w use Win32::API; my $find = new Win32::API("user32", "FindWindowA", 'PN', 'N') or die "No find"; my $send = new Win32::API("user32", "SendMessageA", 'NNNN', 'N') or die "No send"; # Find any Word window my $wordhandle=$find->Call("OpusApp",0); print "Handle: ",$wordhandle,"\n"; $send->Call($wordhandle, 0x0010, 1, 0) if ($wordhandle);
This should close Word and generate a "Quit" event.


/brother t0mas

Replies are listed 'Best First'.
Re: Re: Perl+MSWord (via Win32::OLE) events handling
by Courage (Parson) on Sep 26, 2002 at 14:55 UTC
    In a few words, I meant following idea:

    I am able to communicate from Perl to MS-Word.

    I want to be able to do reverse communication as well, notify my perl script of my event, give it processor ticks

    Thank you for your help which contained interesting ideas
    Courage, the Cowardly Dog

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://200879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found