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

Get Sender of a message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 25th 06, 12:41 AM posted to microsoft.public.outlook.program_vba
Marcus O. M. Grabe
external usenet poster
 
Posts: 4
Default Get Sender of a 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.
Ads
  #2  
Old February 25th 06, 12:52 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Get Sender of a message

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


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