Tootlbar ToolTipText BUG ??

R

Reinfried Englmair

I work with OWC10.

I add in the toolbar a new button with this code:

Sub CustomizeToolbar()
Dim tb
Dim btnNewButton
Dim tbrDefault
' Set a variable to the PivotTableList control's
toolbar.
Set tb = ptable.Toolbar
On Error Resume Next
' Add the image for your custom command to the
toolbar's image list.
'
' Note: You must use a Universal Naming Convention
(UNC) or HTTP path to load the image
' into the image list.
tb.ImageList.ListImages.Add , "MyImage", LoadPicture
("\\servername\directory\PrintCube.gif")
' Trap the potential permissions error.
If Err.Number > 0 Then
' Alert the user.
MsgBox "For security reasons, the script cannot
load PrintCube.gif from" & _
" your hard disk. You must access
PrintCube.gif via a UNC or HTTP" & _
" path."
' Exit the subroutine.
Exit Sub
End If
On Error Goto 0
Set btnNewButton = tb.Buttons.Add(4, "Print with
Excel", , tbrDefault, "MyImage")
' Set the tool tip text.
btnNewButton.ToolTipText = "Print with Excel"
ptable.DisplayScreenTips = True
End Sub

But btnNewButton.ToolTipText = "Print with Excel" shows
NO tooltiptext.

Is this a Bug?????????????

Thanks to all for an answer.
 
A

Alvin Bruney

yes it's a bug. what you will need to do is not call the add button function
until the window has had time to make itself comfy, then the tooltip will
show up.
setTimeout(CustomizeToolbar(),100) will do the trick
 
R

Reinfried Englmair

-----Original Message-----
yes it's a bug. what you will need to do is not call the add button function
until the window has had time to make itself comfy, then the tooltip will
show up.
setTimeout(CustomizeToolbar(),100) will do the trick




.

Thank you for the tip, but with using

iTimerID1 = window.setTimeout("CustomizeToolbar()",100)

the tooltiptext will show up only one time. e.g. I push
the new toolbarbutton, after then, NO tooltiptext show up.
Have you a idea? Thanks
 
R

Reinfried Englmair

Thank you for the tip, but with using

iTimerID1 = window.setTimeout("CustomizeToolbar()",100)

the tooltiptext will show up only one time. e.g. I push
the new toolbarbutton, after then, NO tooltiptext show up.
Have you a idea? Thanks
 
A

Alvin Bruney

ya, i understand. you need to either keep updating it via the button click
event, or mouse over. basically any event you can find that you think may
fire around the toolbar button click is a good candidate. dunno if MS is
working on a fix for this. i understand the bug is deep in the IE
architecture.
 
R

Reinfried Englmair

I have make a workaround for most of the events, e.g. my
own buttons and query:


iTimerIDx = window.setTimeout("CustomizeToolTipText
()",100,"VBScript")

Sub CustomizeToolTipText()
ptable.Toolbar.Buttons(4).ToolTipText = "Print with Excel"
End Sub



Sub ptable_Query()
iTimerIDx = window.setTimeout("CustomizeToolTipText
()",100,"VBScript")
..
..
..
End Sub
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top