View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Alice[_7_] Alice[_7_] is offline
external usenet poster
 
Posts: 4
Default Its getting close

Hi Jim,
tx for this idea. Just simple as that.
I played a little bit arround, getVisible didn't liked me but getScreentip
worked fine.
It's not over yet, because still a unfriendly person could leave in the
button, just rename it an kicks away the onAction.
(Ok i can set the lable with a callback - but the Action?)
And i just couldn't figure out, how to get the onAction Argument back.

In former commandbar handling you could retrieve the onAction arguments,
here i don't know how.

This ribbon is in a few ways not easy to handle and not much information in
the help :-(

But thanks anyway an perhaps you have some more ideas.

Regards




"Jim Rech" schrieb im Newsbeitrag
...
Lets say that you add a callback attribute to the button you want to know
exists like:

getVisible="MySpecialGetVisibleCall"

When the ribbon is created by Excel that sub will be called. It can then

set
a public variable "IAmHere" to True.

If the button exists IAmHere will be True; if it does not the callback

will
never be called so IAmHere will be False.

Of course sub MySpecialGetVisibleCall should set the return value to true.

--
Jim
"Alice" wrote in message
...

"michael.beckinsale" schrieb im
Newsbeitrag ups.com...
On 20 Apr, 13:00, "Alice" wrote:
Hi all,

via xml i add a tab to a ribbon, say something like:

<tab id="myId1" lable="MyLable"
<group id="gr1"
<button id="myButton1" onAction="MySub1" lable="Test1"
<button id="myButton1" onAction="MySub1" lable="Test2"
</group
<group id="gr2"
<button id="myButton1" onAction="MySub2" lable="Test3"
<button id="myButton1" onAction="MySub2" lable="Test4"
</group
</tab

In my workbook i have now two subs

sub MySub1(control as IbRibbonControl)
'some action
end sub

sub MySub2(control as IbRibbonControl)
'some action
end sub

Now it could be possible, that sombody removes the xmlpart for group

gr2.

How can i check in my Sub MySub1 if the group gr2 with the buttons

with
the
given id and onAction arguments exists?

Is there a way? I found only GetMso ... which won't help with own
definitions?

Any idea?

tx in advance
Alice

Alice,

If somebody has 'removed' the XML part then the group/buttons wont be
on the ribbon to trigger the macro so a check wont be necessary.

Or am l missing something?

Regards

Michael Beckinsale

Hi Michael,
say you develop an add-in and you want to have a group with links to

your
homepage or something like that.
Now if somebody removes this group you want to display a message in the
other procedure, that it is not the original add-in and exit the code.
Thats the reason behind.
Regards