Using Ribbon in Inspector window

  • Thread starter tnemec78@googlemail.com
  • Start date
Status
Not open for further replies.
T

tnemec78@googlemail.com

Hi,

Firstly let me thank you for your feedback in this group thus far. I

really appreciate it.

I managed to write a COM Add-in in C++ that has a toolbar with buttons

in every Explorer/Inspector window.

My architecture is as follows:

CAddin - implements _IDTExtensibility2, has handlers for

OnNewExplorer, OnNewInspector

CExplorerWrapper - wrapper class for explorer events

(OnSelectionChange, OnClose, ...)

CInspectorWrapper - wrapper class for inspector events (OnActivate,

OnClose)

CToolbarWrapper - wrapper class for the toolbar buttons

(OnButton1Click, SetEnabled, SetVisible, ...)

Now I decided to use ribbons for 2007+ versions of outlook.

Unfortunately I had to break my OO design here...

My CAddin class newly implements IRibbonExtensibility.

GetCustomUI gets fired and returns XML for the

"Microsoft.Outlook.Mail.Read" Inspector window.

So far so good. I had to implement the OnRibbonButtonClick events

inside my CAddin (don't know how to do this inside CInspectorWrapper)

- this is a pain as it breaks my OO concept, but it works. I simply

cast the RibbonControl->GetContext() to Inspector type. If someone

knew how to do it inside the CInspectorWrapper then please advise - I

can post source code extracts if necessary.

But I don't know how to set the state of the ribbon buttons (enabled/

disabled) inside CInspector::OnActivate. The state of these buttons

can differ in every CInspectorWrapper instance - is there a special

event callback I need to implement or can I do it somehow using my

IRibbonUI pointer that I got from OnLoad handler?
 
I think I might have figured it out already ... The only think I am

really not happy about is the fact that all of the ribbon stuff gets

handled inside my CAddin class. It should really be the job of the

individual CInspectorWrappers. Is it possible to do it that way? Right

now I seem to have quite a lot of unnecessary nearly duplicate code

around in separate classes (once for toolbars and the other time for

ribbons) This could one day be a debugger's nightmare ...
 
The requirement from MS is that the interface handling and callbacks for the

ribbon must be in the same class as the class that implements the

IDTExtensibility interface. So OO design or not that's what you have to do.

What I do is implement a RibbonClicker() method in the Inspector wrapper

class. I call that method in the wrapper class to handle anything that is

specific to that Inspector, such as the states of toggle controls. In the

ribbon callback I identify which Inspector matches the Inspector in the

wrapper class and then I know which wrapper class to call to. Luckily

Outlook 2007 Inspectors can be compared directly using an equality test (==

or for VB using the Is operator), so finding the correct wrapper class is

easy.

I pass in any needed arguments from the ribbon callbacks to my

RibbonClicker() methods, so anything they need in the way of information is

available to them.

<tnemec78@googlemail.com> wrote in message

news:22b35ffd-2c3e-4277-98fe-26a09a9747aa@n8g2000vbb.googlegroups.com...
> I think I might have figured it out already ... The only think I am
> really not happy about is the fact that all of the ribbon stuff gets
> handled inside my CAddin class. It should really be the job of the
> individual CInspectorWrappers. Is it possible to do it that way? Right
> now I seem to have quite a lot of unnecessary nearly duplicate code
> around in separate classes (once for toolbars and the other time for
> ribbons) This could one day be a debugger's nightmare ...
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Disable Contact Card Results when using "Search People" in Outlook Ribbon Using Outlook 7
H Program "Click on Ribbon Button" Using VBA Outlook VBA and Custom Forms 1
H using VBA to edit subject line Outlook VBA and Custom Forms 0
e_a_g_l_e_p_i Need clarification on 2-Step Verification for Gmail using Outlook 2021 Using Outlook 10
e_a_g_l_e_p_i Outlook 2021 not letting me setup my Gmail using pop Using Outlook 1
Geldner Problem submitting SPAM using Outlook VBA Form Outlook VBA and Custom Forms 2
O How to find out the domain and server settings that my Outlook is using? Using Outlook 2
S Outlook 2019 Custom outlook Add-in using Visual Studio Outlook VBA and Custom Forms 0
D Outlook 2021 Using vba code to delete all my spamfolders not only the default one. Outlook VBA and Custom Forms 0
M using excel to sort outlook appointment items Outlook VBA and Custom Forms 4
R Advise on using multiple instances of network files based on customers Outlook VBA and Custom Forms 8
HarvMan Using Emojis in Outlook 365 Using Outlook 3
T Outlook 2019 Not Using Auto Compete After Deletion of 365 Using Outlook 1
M USING INITIALS AS RECIPIENTS Using Outlook 1
T Outlook 2019 Using Gmail aliases in Outlook Using Outlook 6
M Saving emails using Visual Basic - Selecting folder with msoFileDialogFolderPicker Outlook VBA and Custom Forms 6
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
justicefriends How to set a flag to follow up using VBA - for addressee in TO field Outlook VBA and Custom Forms 11
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
I Outlook for Mac 2019 using on desktop and laptop IMAP on both need help with folders Using Outlook 1
David McKay VBA to manually forward using odd options Outlook VBA and Custom Forms 1
H Stationery using between OL 2019 and OL 2010 Using Outlook 0
P Prevent Outlook 2016 from using DASL filter Using Outlook 4
O Calendar - Location: what happens when using my own way of entering locations Using Outlook 1
K can't get custom form to update multiple contacts using VBA Outlook VBA and Custom Forms 3
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
B Change Font and Font size using VBA Outlook VBA and Custom Forms 9
M Outlook 2013 reminder email by using Outlook vba Outlook VBA and Custom Forms 2
X Using Outlook 2013 and Outlook 365 Using Outlook 1
A Going to folder using shortcuts Using Outlook 3
A Outlook replies not using "delivered to" address in From Using Outlook 1
Terry Sullivan E-Mails Sent Using a Group Box Result in 70 Kickbacks Using Outlook 4
O Email not leaving Outbox when using Excel VBA to sync Outlook account Outlook VBA and Custom Forms 4
K Using Outlook 2016 to draw Using Outlook 1
O Outlook 365 - suddenly unable to send using Gmail POP3 Using Outlook 10
N Disable Auto Read Receipts sent after using Advanced Find Using Outlook 4
G Outlook 2016 sync contacts directly between phone and computer using outlook 2016 Using Outlook 0
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
O Save attachments using hotkey without changing attributes Outlook VBA and Custom Forms 1
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
A Edit subject - and change conversationTopic - using VBA and redemption Outlook VBA and Custom Forms 2
A Using or not using apostrophes in search terms has this changed? Using Outlook 0
O Office 365 using POP3 on both laptop and desktop Using Outlook 0
M Using field names to capture a data element Using Outlook 0
B Vba to monitor time to respond to emails using a shared mailbox Outlook VBA and Custom Forms 5
B Looking to get the Recipient email address (or even the "friendly name") from an email I am replying to using VBA Outlook VBA and Custom Forms 4
D Using a VBA Custom Form to Send Reoccurring Email Upon Task Completion Outlook VBA and Custom Forms 4
Z Adding dropdown list using custom form Outlook VBA and Custom Forms 7
O Using .OST and .PST mail thru different providers Using Outlook 5

Similar threads

Back
Top