Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Windows; If (2003) MS Word or Excel are already executing?

by sflitman (Hermit)
on Jun 02, 2010 at 23:36 UTC ( [id://842822]=note: print w/replies, xml ) Need Help??


in reply to Windows; If (2003) MS Word or Excel are already executing?

You can programmatically close windows if you know their handles. Here are two non-tested examples.
use Win32::GuiTest qw/SendMessage/; use Win32::FindWindow; $window = find_window( basename => 'winword.exe' ); SendMessage($window->hwnd,WM_CLOSE,0,0);
OR
use Win32::CtrlGUI; my $window =Win32::CtrlGUI::wait_for_window(qr/Word/); $window->send_keys("!fx"); my $window =Win32::CtrlGUI::wait_for_window(qr/Excel/); $window->send_keys("!fx");
HTH,
SSF

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-19 07:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found