RE: Finding Word and switch focus to it

Discussion in 'Python' started by Hughes, Chad O, Jun 16, 2005.

  1. 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=
    [mailto:python-list-bounces+chad.hughes=] On Behalf Of
    John Henry
    Sent: Wednesday, June 15, 2005 3:21 PM
    To:
    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
     
    Hughes, Chad O, Jun 16, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    565
    John McGrath
    Jan 4, 2005
  2. John Henry

    Finding Word and switch focus to it

    John Henry, Jun 15, 2005, in forum: Python
    Replies:
    0
    Views:
    272
    John Henry
    Jun 15, 2005
  3. zerg
    Replies:
    4
    Views:
    781
  4. Switch Within A Switch

    , Apr 22, 2006, in forum: Javascript
    Replies:
    7
    Views:
    109
    Lasse Reichstein Nielsen
    Apr 22, 2006
  5. Roger
    Replies:
    3
    Views:
    329
Loading...

Share This Page