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 » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

how to change email address in outlook2003



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 29th 06, 05:54 AM posted to microsoft.public.outlook.program_forms
[email protected]
external usenet poster
 
Posts: 1
Default how to change email address in outlook2003

hi,

i want to change email address in outlook2003 when the user submit the
message. i use IExchExtMessageEvents::OnCheckNames(IExchExtCallba ck
*lpExchangeCallback) to change email-address. my code is following.

And i see the email-address have changed on debugging. but at last,
outlook2003 still send message using the old email-address, and abandon my
changed email-adddress, why???

who will give me some suggestions?? or is there any other ways to changed
email address??

thanks a lot.
my email is:

//in VC6, winxp2, outlook2003
class mymail : public IExchExt, public IExchExtMessageEvents
{...};

STDMETHODIMP mymail::OnCheckNames(IExchExtCallback *lpExchangeCallback)
{
HRESULT hRet = S_OK;
LPMESSAGE lpMessage = NULL;
LPMDB lpMdb = NULL;
LPADRLIST pRecipentRows = NULL;
lpExchangeCallback-GetRecipients(&pRecipentRows);
if( pRecipentRows-cEntries == 0 )
return S_FALSE;
for(unsigned long n = 0; n pRecipentRows-cEntries; n++ )
{
for(unsigned long i = 0; i pRecipentRows-aEntries[n].cValues ; i++)
{
ULONG ulTag = pRecipentRows-aEntries[n].rgPropVals[i].ulPropTag;
if( PR_EMAIL_ADDRESS == ulTag || PR_DISPLAY_NAME == ulTag)
{
// i get the current email address correctly, such as
"
LPSTR pNow = pRecipentRows-aEntries[n].rgPropVals[i].Value.lpszA;

// i want to change email address to "
char* p = ";
char* pNewContact = NULL;
MAPIAllocateBuffer(strlen(p)+1, (LPVOID FAR *)&pNewContact);
strcpy((char*)p, (const char*)pNewContact);
pRecipentRows-aEntries[n].rgPropVals[i].Value.lpszA = pNewContact;
}
}
}
hRet = lpExchangeCallback-SetRecipients(pRecipentRows); //is S_OK
return S_FALSE;
}

Ads
 




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
Outlook2003 UpdateJunk Email Filter(KB916521) will not install Bill80205 Outlook - Installation 2 May 18th 06 11:41 PM
Change which address it uses HHMB Outlook - Using Contacts 1 March 16th 06 10:56 PM
Outlook2003: where is the email account info stored for the p Sue Mosher [MVP-Outlook] Outlook - Installation 0 January 30th 06 05:29 PM
Set which local email account can send mail to contacts in address book. (associating an email address with a contact) Scott Streit Outlook - General Queries 3 January 27th 06 03:57 PM
how do you change the email address field for all contacts? Mike Bailey Outlook - Using Contacts 1 January 10th 06 01:15 PM


All times are GMT +1. The time now is 12:57 PM.


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.