Generating "msoult.h" from "msoutl.olb" using VS2005
-
Hi. I'm trying to write a program that automates outlook 2007 using c++. Found some samples, all requires "MSOUTL.H". How do I generate "MSOUTL.H" from my "MSOUTL.OLB"? I'm using VS2005 and Outlook 2007.
Can I make a suggestion - rather than using whatever you are using to try and automate Outlook, use #import to do automation in C++ - it's the simplest and easiest way. Here's how I automate Excel 2007 (getting the active workbook name in this case) - automating Outlook just requires you to determine Outlook's libid (which, from the OLE COM object viewer, is 00062FFF-0000-0000-C000-000000000046):
#include <iostream>
#include <Windows.h>
#import "libid:00020813-0000-0000-C000-000000000046" version("1.6") auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")int main()
{
CoInitializeEx(0, COINIT_APARTMENTTHREADED);
// Ensure the Excel::_ApplicationPtr is destructed before we uninitialize COM.
{
Excel::_ApplicationPtr xl;
if (SUCCEEDED(xl.GetActiveObject(__uuidof(Excel::Application))))
{
std::cout << "Getting name\n";
std::cout << xl->ActiveWorkbook->FullName << std::endl;
}
}
CoUninitialize();
return 0;
}Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p