Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Activate Word (Word XP )

    I need to activate Word (assuing it's running) or launch Word (if it's not) from Outlook. What is the best way to do this?

    I know that there is a method "ActivateMicrosoftApp" but I can't find it in the object browser, and I don't know what its parent object is.

    Thanks,
    Richard Barrett

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Activate Word (Word XP )

    "ActivateMicrosoftApp" sounds familiar from Excel, but the memory is hazy. Here's one way to find Word running or start it if it isn't running:

    Dim appWord As Object
    On Error Resume Next
    Set appWord = GetObject(, "Word.Application")
    If Err.Number = 429 Then
    Set appWord = CreateObject("Word.Application")
    Err.Clear
    ElseIf Err.Number <> 0 Then
    MsgBox Err.Number & " = " & Err.Description, , "Error"
    Exit Sub
    End If
    On Error GoTo 0
    With appWord
    .Visible = True
    .Activate
    End With
    ' More here if you are automating Word rather that just activating it
    Set appWord = Nothing

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Activate Word (Word XP )

    You're right.... that method is peculiar to Excel, which is why I couldn't find it in Outlook. So much for continuity across application!

    Thanks for the code.

Posting Permissions

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