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

Determining account being used



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 25th 06, 12:09 AM posted to microsoft.public.outlook.program_vba
Scott
external usenet poster
 
Posts: 5
Default Determining account being used

In the Item.Send event, I am creating and sending a new message that
will be of type RDOMail.

What I need to be able to do is set the Account based on the account
selected in the Inspector winudow. From the Item.Send Event, I have
the original message as type Outlook.Mailitem.

How do I determine the account selected? Is there a way I can do it
from SafeMailItem, or a way that I can hand the Outlook.MailItem off to
RDOMail which has an Account property? (actually I tried to go from
Outlook.MailItem to SafeMailItem to RDOMail, but the .Account property
is Nothing.)

Thanks,

Scott

Ads
  #2  
Old January 25th 06, 07:00 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Determining account being used

Try something like the following

MailItem.Save 'to make sure EntryId is available
EntryID = MailItem.EntryID
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT 'Outlook 2002 and up
only
set Mail = Session.GetMessageFromID(EntryID)
set Account = Mail.Account

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Scott" wrote in message
oups.com...
In the Item.Send event, I am creating and sending a new message that
will be of type RDOMail.

What I need to be able to do is set the Account based on the account
selected in the Inspector winudow. From the Item.Send Event, I have
the original message as type Outlook.Mailitem.

How do I determine the account selected? Is there a way I can do it
from SafeMailItem, or a way that I can hand the Outlook.MailItem off to
RDOMail which has an Account property? (actually I tried to go from
Outlook.MailItem to SafeMailItem to RDOMail, but the .Account property
is Nothing.)

Thanks,

Scott



  #3  
Old January 25th 06, 05:39 PM posted to microsoft.public.outlook.program_vba
Scott
external usenet poster
 
Posts: 5
Default Determining account being used

Worked like a charm!

Many many thanks,

Scott

 




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
Does deleting e-mail account delete the account from my computer? MPKinney Outlook - Installation 2 February 5th 06 01:26 AM
Incoming email from second account received into default account SSG Outlook - Installation 4 January 19th 06 01:08 AM
Outlook 2003 changes the outgoing account when unable to send by selected account HeidarV Outlook - General Queries 1 January 16th 06 03:26 PM
POP3 account errors, although internet access/email account are wo phil Outlook Express 4 January 15th 06 09:53 AM
Outlook 2003 changes the outgoing account when unable to send by selected account HeidarV Outlook - General Queries 0 January 14th 06 09:44 AM


All times are GMT +1. The time now is 08:29 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.