A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

setting an IMAP accoutn as default from an addin



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old August 6th 08, 12:47 AM posted to microsoft.public.outlook.program_addins
exchnerd
external usenet poster
 
Posts: 1
Default setting an IMAP accoutn as default from an addin

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 09:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.