Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Finding Word and switch focus to it

Reply
Thread Tools

RE: Finding Word and switch focus to it

 
 
Hughes, Chad O
Guest
Posts: n/a
 
      06-15-2005
The first part is easy. I will have to think about the second part. To
find an opened copy of Word and switch focus to it do the following:

from win32com.client import Dispatch
word = Dispatch('Word.Application')
wdWindowStateNormal = 0
if len(word.Documents):
word.Activate()
if word.WindowState != wdWindowStateNormal:
word.WindowState = wdWindowStateNormal

-----Original Message-----
From: python-list-bounces+chad.hughes=(E-Mail Removed)
[mailtoython-list-bounces+chad.hughes=(E-Mail Removed)] On Behalf Of
John Henry
Sent: Wednesday, June 15, 2005 3:21 PM
To: http://www.velocityreviews.com/forums/(E-Mail Removed)
Subject: Finding Word and switch focus to it


Does anybody know how to find an opened copy of Word and switch focus to
it, wait until Word is closed, before continuing my Python script? I
tried to search for the answer from Google and nothing stands out.

Running under Windows XP.

Thanks,

--
John

--
http://mail.python.org/mailman/listinfo/python-list
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
emulating window.focus in Body onload() event and setting focus to a control on same page Jason ASP .Net 4 05-07-2007 05:54 PM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
Finding Word and switch focus to it John Henry Python 0 06-15-2005 10:20 PM
Why "Focus and Recompose" causes back-focus issues Carl Miller Digital Photography 7 03-10-2005 12:14 PM
difference b/w layer 2 switch and layer 3 switch praveen Cisco 1 10-22-2003 07:19 AM



Advertisments