Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Difference between Doc and App ActiveWindow? (XP/2000)

    Is there any difference between the Window object returned by Application.ActiveWindow and Document.ActiveWindow?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Difference between Doc and App ActiveWindow? (XP/2000)

    If the document is the active document, the result is the same. But if the document is not the active window, the result will be different.

    Copy this code to a module, and run it (F5). Inspect the result in the Immediate window (Ctrl+G):

    Sub ActiveWindowTest()
    Dim doc As Document
    Set doc = ActiveDocument
    Debug.Print "Originally:"
    Debug.Print "App", Application.ActiveWindow.Caption
    Debug.Print "Doc", doc.ActiveWindow.Caption
    Documents.Add
    Debug.Print "After adding new doc:"
    Debug.Print "App", Application.ActiveWindow.Caption
    Debug.Print "Doc", doc.ActiveWindow.Caption
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Difference between Doc and App ActiveWindow? (XP/2000)

    Thanks Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •