March 5th, 2014, 05:10 PM
[RESOLVED] C++ , MFC and create folders in Outlook
I am wokring on a project that has used an MFC DLL in conjunction with Outlook to send and archive mail. I need to be able to create folders for integration from an older mail system. I have looked online to see if there are examples in C++ (since I have to modify the existing C++ dll to include the funcitonality). I realize it is much simpler using VBA or C#, but I am limited with my choice.
I essentially want to use the MFC type lib for Outlook 14 and use the CMAPIFolder,CFolders create folders in the Inbox.
here is a sample of the code:
//I have included the necessary header files
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
if (!olApp.CreateDispatch(_T("Outlook.Application"), &e))
::MessageBoxA(0,"","Please start Outlook and try again!!",0);
//get inbox folder .
CFolders cf_Inbox = curStore.GetDefaultFolder(OutlookFolders:lFolder_Inbox);
cf_Inbox.Add((LPTSTR)(LPCTSTR)createFolderName,folderType); //<<--- keep getting a member not found error.
I am not sure if I am going about this the correct way. I would appreciate any input.
Thanks in advance
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.