Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Sep 2006
    Location
    New York, New York, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Hide Word Icon in Taskbar When Automated From VB App

    I have a VB app that automates Word's Spell Checker. I only want to show the Spell Check results window from the VB app, and don't want the Word application icon to appear in the taskbar. Googling didn't provide any answers, just more questions.

    Here is the code I have so far, for a button on a form:

    Private Sub Command1_Click()

    Dim objWord As Object
    Dim objDoc As Object

    Set objWord = CreateObject("Word.Application")
    Set objDoc = objWord.Documents.Add

    With objDoc
    .Activate
    .Content.Text = "This is some sample text with misspellings - ddfdfefwer"
    objWord.Visible = True
    objWord.WindowState = 2 'wdWindowStateMinimized
    objWord.Activate
    .CheckGrammar
    .Saved = True
    .Close
    End With

    Set objDoc = Nothing
    objWord.Quit
    Set objWord = Nothing

    MsgBox "Finished"

    End Sub

    Is there an API that will prevent the icon from appearing in the taskbar, yet still allow the Spell Check results window to be displayed?

    I need this to work in a few Windows versions -- XP, Vista, Win 7, and also for both 32-bit and 64-bit.

    Also, I noticed that when I run similar code for 64-bit Windows, the Spell Check window is hidden -- get a flashing Word icon in the taskbar and need to click on it to display the Spell Check results window. Why?

    Thanks!

  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
    Does it work at all if you set

    Code:
    objWord.Visible = False

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Have you tried?
    objWord.TaskVisible = false
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    Star Lounger
    Join Date
    Sep 2006
    Location
    New York, New York, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts
    jscher! I remember you from my old Word VBA coding days. You are a king among kings!

    Unfortunately, no, that had no effect.

  5. #5
    Star Lounger
    Join Date
    Sep 2006
    Location
    New York, New York, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts
    That property is not valid for the Application object. Is this a .NET property? I'm using VB6.

Posting Permissions

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