How to show/hide Outlook Explorer BackStage Group

Add-in Express™ Support Service
That's what is more important than anything else

How to show/hide Outlook Explorer BackStage Group
How to show/hide a custom BackStage Group on the Print tab, depending upon selected item 
Roger Middlebrook


Guest


I have a TadxBackStageGroup with Id = 'MyID'. It is in the BackStage tab with IdMso = 'TabPrint'

I would like to make the group visible if the user goes to the print tab with a Mail Item selected.

I would like to make the group invisible if the user goes to the print tab with a Calendar Item selected.

The group does not reference a built in group, nor does it contain any built-in controls.

I have tried handling PropertyChanging where PropertyType = rcptVisible but this is presumably not the way to do it because I can't make it work.

Thanks in advance
Posted 22 Mar, 2013 11:03:03 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Roger,

You can trace selection changes and modify the Visible property of the group in accordance with the current selection.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Mar, 2013 12:07:47 Top
Roger Middlebrook


Guest


Ah, I understand what you are suggesting. Thank you. The same group is in Outlook Explorer, Compose Email and Read Email. In order to make sure what happens in Explorer does not affect Compose and Read I presume I will need separate groups that have the same functions?

So, under what circumstances should I use the PropertyChanging event and rcptVisible? Would it only be used when I have two windows of the same type (perhaps two Email Read) and I need BackStageView to behave differently for each?
Posted 22 Mar, 2013 12:47:26 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Roger,

Roger Middlebrook writes:
The same group is in Outlook Explorer, Compose Email and Read Email. In order to make sure what happens in Explorer does not affect Compose and Read I presume I will need separate groups that have the same functions?


Exactly.

Roger Middlebrook writes:
So, under what circumstances should I use the PropertyChanging event and rcptVisible? Would it only be used when I have two windows of the same type (perhaps two Email Read) and I need BackStageView to behave differently for each?


Yes, you've got the idea precisely.


Andrei Smolin
Add-in Express Team Leader
Posted 25 Mar, 2013 05:26:22 Top
Roger Middlebrook


Guest


Still on the same subject, I would like my BackStage Group to appear for msrOutlookMailRead, msrOutlookMailCompose and msrOutlookMeetingRequestRead. Thanks to ADX it does this beautifully in an inspector window .

What do you think is the best way to check the selected item so it only appears for items of this type in the Outlook Explorer window?

Initially I used

with OutlookApp.ActiveExplorer.Selection do
  if (Count > 0) and (Supports(Item(1), IID__MailItem, vItem)) then
    {Make the BackStage Group visible, etc...}


but now I am hoping you have a better way of checking for other item types and states.

Thank you
Posted 25 Mar, 2013 11:47:55 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Roger,

Specifying msrOutlookMailRead, msrOutlookMailCompose and msrOutlookMeetingRequestRead in the Ribbons property of a Backstage group will show the group in the Backstage View of an inspector window showing the corresponding Outlook item. If you also need that group to be shown in the Backstage View of the Explorer window where any of such item is selected, the only way is to trace the current selection and modify the visibility of the group when a required Outlook item is selected. Note that the group (this also may be some other Backstage group) must have msrOutlookExplorer in this case.


Andrei Smolin
Add-in Express Team Leader
Posted 26 Mar, 2013 09:15:40 Top
Roger Middlebrook


Guest


Andrei

I do understand this. I was wondering what the best way of checking an item is to see if, for example, it is a "read meeting request", the equivalent of msrMeetingRequestRead.

In short, "what is the best way of checking the selected item in an Explorer window to see if it is a meeting request that has been read?"

I have been trawling the web for a succinct answer but cannot find one.
Posted 26 Mar, 2013 09:29:39 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Roger,

I've written this VBA macro:

Private Sub InspectorWork()
Dim insp As Outlook.Inspector
    Set insp = Application.ActiveInspector
    If insp Is Nothing Then
        Stop
        Exit Sub
    End If
Dim anItem As Object
    Set anItem = insp.CurrentItem
Stop
End Sub


Make sure that a meeting request sent to you is opened in the active inspector window. Now open the Outlook VBA IDE (Alt+F11). In the Soultion Explorer window, find the item ThisOutlookSession, double-click it, paste the macro into the code pane, place the text cursor on any line of the macro and press F5. When the code stops, study the anItem variable in View | Locals Window.

As far as I can see, to show a Ribbon control in the Ribbon msrOutlookMeetingRequestRead, the item must be of the MeetingItem type; it should have Class=olMeetingRequest and Sent=true.


Andrei Smolin
Add-in Express Team Leader
Posted 27 Mar, 2013 07:51:48 Top
Roger Middlebrook


Guest


Thank you Andriy. The last bit was what I really wanted:

As far as I can see, to show a Ribbon control in the Ribbon msrOutlookMeetingRequestRead, the item must be of the MeetingItem type; it should have Class=olMeetingRequest and Sent=true


I just wanted to know the best way of identifying the item type and using the Class and Sent seems fine.

Sorry I didn't make it clear
Posted 02 Apr, 2013 05:56:16 Top