![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi
I need to set my IMAP4 account as the default store. Can anyone4 help me in this regard? Here is my code - HRESULT hRes = S_OK; IMsgServiceAdmin* pMsgAdmin = NULL; IMAPITable* lppTable = NULL; LPMAPIERROR* lppError = NULL; try { if (FAILED(hRes = m_lpMAPISession-AdminServices(0,&pMsgAdmin)) ) { Log(true,L"Error getting Admin service Table."); return hRes; } if (FAILED(hRes = pMsgAdmin-GetMsgServiceTable(0, // Flags. &lppTable))) // Pointer to table. { Log(true,L"Error getting Message Service Table."); return hRes; } enum {iEntID,iSvcName, iSvcUID, cptaSvc}; SRestriction sres; // Restriction structure. SPropValue SvcProps; // Property structure for restriction. LPSRowSet lpSvcRows = NULL; // Rowset to hold results of table query. //SizedSPropTagArray(cptaSvc,sptCols) = { cptaSvc, PR_ENTRYID, PR_SERVICE_NAME, PR_SERVICE_UID,PR_DISPLAY_NAME_W}; SizedSPropTagArray(cptaSvc,sptCols) = { cptaSvc, PR_ENTRYID, PR_SERVICE_NAME, PR_SERVICE_UID }; sres.rt = RES_CONTENT; sres.res.resContent.ulFuzzyLevel = FL_SUBSTRING; sres.res.resContent.ulPropTag = PR_SERVICE_NAME; sres.res.resContent.lpProp = &SvcProps; SvcProps.ulPropTag = PR_SERVICE_NAME; SvcProps.Value.lpszW = L"INTERSTOR"; //lppTable-FindRow() if (FAILED(hRes = HrQueryAllRows(lppTable, (LPSPropTagArray)&sptCols, &sres, NULL, 0, &lpSvcRows))) { Log(true,L"Error querying table for new message Service "); return hRes; } //LPMAPIUID lpMyServiceUID = (LPMAPIUID)lpSvcRows-aRow-lpProps [iSvcUID].Value.bin.lpb; LPENTRYID lpEntryID = (LPENTRYID)lpSvcRows-aRow-lpProps[iEntID]. Value.bin.lpb; if (FAILED (hRes = m_lpMAPISession-SetDefaultStore (MAPI_DEFAULT_STORE ,16,lpEntryID)) ) { Log(true,L"Failed to SetDefaultStore %08x",hRes); return hRes; } THe LPENTRYID seems to be invalid. Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
imap setting for OUtlook 2003 Sent Folder | Southern at Heart | Outlook - Installation | 0 | June 10th 08 04:48 PM |
Regarding Default Namespace property of C# VSTO 2005 Outlook Addin | Bharathi | Outlook - Using Forms | 0 | November 26th 07 05:37 AM |
IMAP default delivery location (Outlook) | Russ | Outlook - General Queries | 3 | July 4th 06 03:38 AM |
Setting up an IMAP account | Crockett | Outlook - Installation | 14 | May 30th 06 03:01 PM |
Is there a policy or registry setting for setting the default addr | scsi | Outlook - Installation | 1 | February 28th 06 01:19 PM |