![]() |
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 all,
I normally do programming VBA within Excel or Word or just VB itself, so I do not know the objects in Outlook. How can I get the sender of a message a) when the message is opened b) when the message is just marked is the list of msgs? Thanks for any help, Marcus. |
Ads |
#2
|
|||
|
|||
![]()
In Outlook 2003, you can use the MailItem.SenderEmailAddress, but note that it's subject to security prompts.
In earlier versions, there is no Outlook property that returns the sender's email address. You can either use CDO (or Redemption to avoid security prompts -- http://www.dimastr.com/redemption/) to get the From address or use Outlook to get the Reply To address. Sample code at http://www.outlookcode.com/d/code/getsenderaddy.htm To get the SMTP address from an Exchange sender or recipient, use CDO or Redemption and the PR_EMAIL (&H39FE001E) MAPI property to obtain the SMTP address from the AddressEntry object. See http://www.outlookcode.com/d/code/ge...htm#redemption and http://www.cdolive.com/cdo5.htm#EMailAddressOfSender for examples. a) when the message is opened Application.ActiveInspector.CurrentItem b) when the message is just marked is the list of msgs? Application.ActiveExplorer.Selection(1) -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Marcus O. M. Grabe" wrote in message ... Hi all, I normally do programming VBA within Excel or Word or just VB itself, so I do not know the objects in Outlook. How can I get the sender of a message a) when the message is opened b) when the message is just marked is the list of msgs? Thanks for any help, Marcus. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
can i group emails by sender & by number of items for each sender | baffled_by_tech | Outlook - Using Contacts | 2 | March 5th 06 09:27 PM |
BCC and sender email | miradoro | Outlook - Using Contacts | 3 | February 27th 06 09:06 PM |
I cant receive messages from one sender only | Dylanfan | Outlook Express | 9 | February 26th 06 09:12 PM |
Error - Rejected as sender | Billc1022 | Outlook - Installation | 0 | February 25th 06 06:01 PM |
Junk mail: How to create a button for "Add sender to blocked sender list" | Nananana | Outlook - General Queries | 2 | February 2nd 06 01:37 PM |