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

Retrieve actual value of .To without saving first?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 4th 08, 02:54 PM posted to microsoft.public.outlook.program_addins
Steffen Grellmann[_2_]
external usenet poster
 
Posts: 9
Default Retrieve actual value of .To without saving first?

Hi newsgroup,

as you can see from the code snippet below I'm trying to read the
content from the "To" field of a new Outlook mailmessage. It seems
that the item has to been saved first in order to get the \actual\
value from the .To-field.

I guess some of you will recommend to work with the Recipients
collection instead. If doing so, saving the item seems to be required
too to get actual values.

Is there another way that does not require to save the item first?

Dim itm As Object
Set itm = ActiveDocument.MailEnvelope.Item

With itm
MsgBox .To
End With

Set itm = Nothing

Kind regards,

Steffen
Ads
  #2  
Old September 5th 08, 04:38 AM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Retrieve actual value of .To without saving first?

itm.Recipients.Resolve should do the same thing as saving the item -- resolve
all recipient names to actual addresses.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"Steffen Grellmann" wrote:

Hi newsgroup,

as you can see from the code snippet below I'm trying to read the
content from the "To" field of a new Outlook mailmessage. It seems
that the item has to been saved first in order to get the \actual\
value from the .To-field.

I guess some of you will recommend to work with the Recipients
collection instead. If doing so, saving the item seems to be required
too to get actual values.

Is there another way that does not require to save the item first?

Dim itm As Object
Set itm = ActiveDocument.MailEnvelope.Item

With itm
MsgBox .To
End With

Set itm = Nothing

Kind regards,

Steffen

 




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
Email display ACTUAL From:, not persons name? Bill[_2_] Outlook - General Queries 2 July 28th 07 03:29 PM
How to find out actual link address Doug Outlook - Using Contacts 2 July 10th 07 11:30 PM
"Report.IPM.NOTE.NDR" retrieve actual recipient that NDR has been set to [email protected] Outlook and VBA 7 May 26th 07 12:55 AM
How can I get Outlook to display DAY OF THE WEEK beside the actual date? ship Outlook - Calandaring 4 October 10th 06 06:42 AM
How to set reminder after actual start time Indrek Tiidrus Outlook - Calandaring 1 March 31st 06 11:33 AM


All times are GMT +1. The time now is 09:15 AM.


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.