Search code examples
vbaoutlookoutlook-addin

change the ribbon if new outlook-folder is selected


I want to show/hide Buttons depending on the Name of the actual Folder.

No Problem to do this with

    Me.btn1.Visible = True 'or false, whatever is necessary

But: how can I check for a change of the current Folder?

Thanks Max


Solution

  • Your ribbon XML must specify the getVisible callback name.

    Call IRibbonUI.Invalidate, Outlook will then invoke your getVisible/getEnabled callbacks.

    IRibbonUI can be cached when Outlook invokes your onLoad callback (specified on the customUI XML element).