I'm trying to automate Outlook 2007. I'm using the type library to import Outlook objects. I figured out how to do almost any thing but I do not know how to click on a button on a tool bar. Here is my code so far:
| Code: |
OleInitialize(NULL);
_NameSpacePtr pNameSpace;
MAPIFolderPtr pDrafts;
_MailItemPtr pNewMailItem;
MAPIFolderPtr pCalendar;
_AppointmentItemPtr pAppointmentItem;
RecipientsPtr pRecipients;
// Create an Outlook.Application pointer.
_ApplicationPtr pApp("Outlook.Application");
//Make Excel Visible and display a message
//app.SetVisible(TRUE);
cout << pApp->GetVersion() << endl;
// Create NameSpace pointer.
pNameSpace = pApp->GetNamespace (L"MAPI");
pCalendar = pNameSpace->GetDefaultFolder (OlDefaultFolders::olFolderCalendar);
pAppointmentItem = pApp->CreateItem (OlItemType::olAppointmentItem);
pAppointmentItem->Display ();
pAppointmentItem->Subject = "Test Appointement Subject";
_InspectorPtr pCalendarInspectorItem = pAppointmentItem->GetInspector;
_CommandBarsPtr pCommandBarsItem = pCalendarInspectorItem->CommandBars;
CommandBarPtr pCommandBarItem;
|
Inspector object is used to access all window objects. As you can see I'm trying to use CommandBar to access toolbar (Ribbon) buttons. My question is for example how to click on a Reccurence button?