T
Tom at GSD
Hello,
I do not know if this is the correct forum - but to be honest I could not
find a forum that relates to outlook and C++. My question is pretty simple
and prehaps somebody might have an idea how to solve this.
My assignment is to retrieve all USER email addresses from the current
logged on user. I am able to retrieve the primary address - but am unable to
retieve any of the other addresses. Is there a way to get a collection of
user addresses? I have not seen any examples of this in either VB or VC.
Below is a snip of code that I use to get the user address and name. I do
not see any way to get a collection of user addresses if the user has
mutilple emails.
Any help would be greatly appreciated.
_Session* m_pMapiSess;
..
..
..
if(!m_pMapiSess->CreateDispatch("Mapi.session", &e))
{
CString str;
str.Format("CreateDispatch() failed w/error 0x%08lx \n", e.m_sc);
TRACE0(str);
}
else
{
COleVariant vt(DISP_E_PARAMNOTFOUND, VT_ERROR);
_variant_t varSave(false);
_variant_t varDialog(0L);
_variant_t vtReturn = m_pMapiSess->Logon(vt, vt, varSave,
varSave, varDialog, vt, vt);
vtReturn = m_pMapiSess->GetCurrentUser();
AddressEntry_cdo addEntry = vtReturn.pdispVal;
vtReturn = addEntry.GetName();
vtReturn = addEntry.GetAddress();
}
Thanks,
Tom -
I do not know if this is the correct forum - but to be honest I could not
find a forum that relates to outlook and C++. My question is pretty simple
and prehaps somebody might have an idea how to solve this.
My assignment is to retrieve all USER email addresses from the current
logged on user. I am able to retrieve the primary address - but am unable to
retieve any of the other addresses. Is there a way to get a collection of
user addresses? I have not seen any examples of this in either VB or VC.
Below is a snip of code that I use to get the user address and name. I do
not see any way to get a collection of user addresses if the user has
mutilple emails.
Any help would be greatly appreciated.
_Session* m_pMapiSess;
..
..
..
if(!m_pMapiSess->CreateDispatch("Mapi.session", &e))
{
CString str;
str.Format("CreateDispatch() failed w/error 0x%08lx \n", e.m_sc);
TRACE0(str);
}
else
{
COleVariant vt(DISP_E_PARAMNOTFOUND, VT_ERROR);
_variant_t varSave(false);
_variant_t varDialog(0L);
_variant_t vtReturn = m_pMapiSess->Logon(vt, vt, varSave,
varSave, varDialog, vt, vt);
vtReturn = m_pMapiSess->GetCurrentUser();
AddressEntry_cdo addEntry = vtReturn.pdispVal;
vtReturn = addEntry.GetName();
vtReturn = addEntry.GetAddress();
}
Thanks,
Tom -