Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Toolbar icon doesn appear in Word 2003 (2003)

    The code below creates a toolbar with a single icon on it and it works fine in Word 2000 and Word XP but the icon does not appear in Word 2003 until after the mouse passes over the toolbar, then it continues to appear. I believe it may just be a MS Word 2003 problem but figured I asked on Woody's ust in case someone else has run into this problem and found a solution. Special note....this problem does not appear if there is more than one icon on the toolbar, only if there is one icon.

    Set cbtButton = cbrToolbar.Controls.Add(Type:=msoControlButton, Temporary:=True)
    If cbrToolbar.Enabled Then
    cbrToolbar.Visible = True
    End If
    cbtButton.Visible = True
    cbtButton.Enabled = True
    cbtButton.FaceId = iFaceID
    cbtButton.ToolTipText = strSecurityToopTip
    cbtButton.Style = msoButtonAutomatic

  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: Toolbar icon doesn appear in Word 2003 (2003)

    Very strange. Do you have the first Service Pack installed?

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Toolbar icon doesn appear in Word 2003 (2003)

    Thanks for replying to my question. Yes I have the latest service pack and it is very strange. I didn't mentioned it before but the toolbar in question is being created via a COM addin but like I said it works fine in Word 2000 and Word XP and if there is more than one icon on the toolbar then the icons appear. It is only when the toolbar has only one icon that the icon does not appear until the cursor gets on it and then it remains.

  4. #4
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Toolbar icon doesn appear in Word 2003 (2003)

    Well I figured out what to do to make the icon appear and that involved moving two lines of code as shown below and talk about strange.

    Set cbtButton = cbrToolbar.Controls.Add(Type:=msoControlButton, Temporary:=True)
    If cbrToolbar.Enabled Then
    cbrToolbar.Visible = True
    End If
    ' cbtButton.Visible = True Notice this line and the next one are commented out and have been moved
    ' cbtButton.Enabled = True to after the line "cbtButton.Style = msoButtonAutomatic"

    cbtButton.FaceId = iFaceID
    cbtButton.ToolTipText = strSecurityToopTip
    cbtButton.Style = msoButtonAutomatic
    cbtButton.Visible = True
    cbtButton.Enabled = True

Posting Permissions

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