RE: RibbonX - programatically enable/disable buttons
- From: "Patrick Schmid [MVP]" <pdschmid@xxxxxxxxxxxxxxx>
- Date: Tue, 10 Apr 2007 03:43:05 +0000
You use the getEnabled callback and return whatever state the button has to be in.
The trick is to tell Office to execute the callback again. To do so, you need to implement the onLoad callback for customUI. That will give you an IRibbonUI object. Store that.
When you need to tell Office to execute a callback again, call the IRibbonUI.InvalidateControl(controlId) method. You can also use IRibbonUI.Invalidate() to invalidate all controls at once, but I would highly suggest to use the InvalidateControl method at all times.
Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
"David Thielen" <thielen@xxxxxxxxxxxxx> wrote in message news:F138AC2D-6E95-45D3-8F75-51A64091EAEA@xxxxxxxxxxxxx:
Please correct me if I am wrong but that will be called when the Ribbon is
first shown. But I enable/disable controls based on the position of the caret.
Think of the Cut and Copy buttons - they will enable if text is selected and
disable if no text is selected. I need to be able to do the same thing.
So how can I enable/disable the buttons after my ribbon is displayed? It
must be possible because it happens for the Cut and Copy buttons.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Wei Lu [MSFT]" wrote:
> Hello Dave,
>
> When you devlop the custom Ribbon control, you could use the getVisiable
> callback in the XML to programmatically determine whether to show or hide a
> tab.
>
> You could follow the example in the article:
>
> http://msdn2.microsoft.com/en-us/library/aa338202.aspx#OfficeCustomizingRibb
> onUIforDevelopers_Access
>
> Sincerely,
>
> Wei Lu
>
> Microsoft Online Community Support
>
> ==================================================
>
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
>
> ==================================================
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
.
- Follow-Ups:
- RE: RibbonX - programatically enable/disable buttons
- From: David Thielen
- RE: RibbonX - programatically enable/disable buttons
- From: David Thielen
- RE: RibbonX - programatically enable/disable buttons
- References:
- RE: RibbonX - programatically enable/disable buttons
- From: David Thielen
- RE: RibbonX - programatically enable/disable buttons
- Prev by Date: Re: RibbonX - what is keytip?
- Next by Date: Re: Shared Add-In installation problem
- Previous by thread: RE: RibbonX - programatically enable/disable buttons
- Next by thread: RE: RibbonX - programatically enable/disable buttons
- Index(es):
Loading