PC Review


Reply
Thread Tools Rate Thread

Adding Tip Text to custom toolbar in 2007

 
 
vbaexperimenter
Guest
Posts: n/a
 
      26th Jun 2008
I used Ron de Bruin site (http://www.rondebruin.nl/ribbon.htm) to create a
custom group and buttons, however I need my buttons to have TipText when the
mouse is put over it. I can not seem to figure out a way to do this. This is
the code for the button it is straight from Ron's site with minor changes:


<button id="Checkmark" size="normal" onAction="Checkmark" image="Checkmark"
/>

 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      26th Jun 2008
You can add this

screentip="your Tip"

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"vbaexperimenter" <(E-Mail Removed)> wrote in message
news:5A92F83D-1000-4717-BDB4-(E-Mail Removed)...
>I used Ron de Bruin site (http://www.rondebruin.nl/ribbon.htm) to create a
> custom group and buttons, however I need my buttons to have TipText when the
> mouse is put over it. I can not seem to figure out a way to do this. This is
> the code for the button it is straight from Ron's site with minor changes:
>
>
> <button id="Checkmark" size="normal" onAction="Checkmark" image="Checkmark"
> />
>


 
Reply With Quote
 
vbaexperimenter
Guest
Posts: n/a
 
      26th Jun 2008
Thanks for your help that worked. Another question unrelated, I have my
custom macros saved into an *.xlam file, which is where I saved your xml
code. When I click on the Callbacks button it isn't associating my macros
with the button. Now I don't have any vb code other then what I copy below do
I need something above or below it? Here is my macro:

Sub Checkmark()

InsertPicture13 "D:\Program Files\Microsoft
Office\Office12\Tickmarks\Check_mark.bmp", ActiveCell, True, True
End Sub

Sub InsertPicture13(PictureFileName As String, TargetCell As Range, _
CenterH As Boolean, CenterV As Boolean)
' inserts a picture at the top left position of TargetCell
' the picture can be centered horizontally and/or vertically
Dim p As Object, t As Double, l As Double, w As Double, h As Double
If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
If Dir(PictureFileName) = "" Then Exit Sub
' import picture
Set p = ActiveSheet.Pictures.Insert(PictureFileName)
' determine positions
With TargetCell
t = .Top
l = .Left
If CenterH Then
w = .Offset(0, 1).Left - .Left
l = l + w / 2 - p.Width / 2
If l < 1 Then l = 1
End If
If CenterV Then
h = .Offset(1, 0).Top - .Top
t = t + h / 2 - p.Height / 2
If t < 1 Then t = 1
End If
End With
' position picture
With p
..Top = t
..Left = l
End With
Set p = Nothing

End Sub


Other then the changes I showed you in your xml code nothing has changed.
What am I doing wrong?



"Ron de Bruin" wrote:

> You can add this
>
> screentip="your Tip"
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "vbaexperimenter" <(E-Mail Removed)> wrote in message
> news:5A92F83D-1000-4717-BDB4-(E-Mail Removed)...
> >I used Ron de Bruin site (http://www.rondebruin.nl/ribbon.htm) to create a
> > custom group and buttons, however I need my buttons to have TipText when the
> > mouse is put over it. I can not seem to figure out a way to do this. This is
> > the code for the button it is straight from Ron's site with minor changes:
> >
> >
> > <button id="Checkmark" size="normal" onAction="Checkmark" image="Checkmark"
> > />
> >

>
>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      26th Jun 2008
Hi

When you have the file open in the Custom UI editor
Click on the "Create callbacks" button

Copy what you see in a module of the workbook

You see something like this

'Callback for customButton1 onAction
Sub Macro1(control as IRibbonControl)

End Sub

You can add the code in this callback

Sub Macro1(control as IRibbonControl)
InsertPicture13 "D:\Program Files\Microsoft
Office\Office12\Tickmarks\Check_mark.bmp", ActiveCell, True, True
End Sub

Or call the macro you have

Sub Macro1(control as IRibbonControl)
Call Checkmark
End Sub




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"vbaexperimenter" <(E-Mail Removed)> wrote in message
news:4D903D2C-0561-432D-AECE-(E-Mail Removed)...
> Thanks for your help that worked. Another question unrelated, I have my
> custom macros saved into an *.xlam file, which is where I saved your xml
> code. When I click on the Callbacks button it isn't associating my macros
> with the button. Now I don't have any vb code other then what I copy below do
> I need something above or below it? Here is my macro:
>
> Sub Checkmark()
>
> InsertPicture13 "D:\Program Files\Microsoft
> Office\Office12\Tickmarks\Check_mark.bmp", ActiveCell, True, True
> End Sub
>
> Sub InsertPicture13(PictureFileName As String, TargetCell As Range, _
> CenterH As Boolean, CenterV As Boolean)
> ' inserts a picture at the top left position of TargetCell
> ' the picture can be centered horizontally and/or vertically
> Dim p As Object, t As Double, l As Double, w As Double, h As Double
> If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
> If Dir(PictureFileName) = "" Then Exit Sub
> ' import picture
> Set p = ActiveSheet.Pictures.Insert(PictureFileName)
> ' determine positions
> With TargetCell
> t = .Top
> l = .Left
> If CenterH Then
> w = .Offset(0, 1).Left - .Left
> l = l + w / 2 - p.Width / 2
> If l < 1 Then l = 1
> End If
> If CenterV Then
> h = .Offset(1, 0).Top - .Top
> t = t + h / 2 - p.Height / 2
> If t < 1 Then t = 1
> End If
> End With
> ' position picture
> With p
> .Top = t
> .Left = l
> End With
> Set p = Nothing
>
> End Sub
>
>
> Other then the changes I showed you in your xml code nothing has changed.
> What am I doing wrong?
>
>
>
> "Ron de Bruin" wrote:
>
>> You can add this
>>
>> screentip="your Tip"
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "vbaexperimenter" <(E-Mail Removed)> wrote in message
>> news:5A92F83D-1000-4717-BDB4-(E-Mail Removed)...
>> >I used Ron de Bruin site (http://www.rondebruin.nl/ribbon.htm) to create a
>> > custom group and buttons, however I need my buttons to have TipText when the
>> > mouse is put over it. I can not seem to figure out a way to do this. This is
>> > the code for the button it is straight from Ron's site with minor changes:
>> >
>> >
>> > <button id="Checkmark" size="normal" onAction="Checkmark" image="Checkmark"
>> > />
>> >

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding custom buttons to the Standard toolbar versus a custom toolbar cainrandom@gmail.com Microsoft Outlook Program Addins 2 9th Oct 2008 05:13 PM
Re: Need help w using custom image for custom toolbar in Excel 2007 Chip Pearson Microsoft Excel Programming 9 23rd Jun 2008 06:05 PM
adding custom images to a button on custom toolbar Mousam Microsoft Excel Programming 1 13th Jul 2007 04:28 PM
Adding Custom Toolbar =?Utf-8?B?VG9kZA==?= Microsoft Word Document Management 11 18th Oct 2006 11:49 PM
Adding custom button to toolbar =?Utf-8?B?S2F0aHk=?= Microsoft Outlook Discussion 1 16th Jul 2006 09:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 AM.