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

Retrieving information from incomming mail items.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 17th 06, 10:43 PM posted to microsoft.public.outlook.program_vba
Jan G. Thorstensen
external usenet poster
 
Posts: 1
Default Retrieving information from incomming mail items.

I am using Outlook2k and WinXP. When a new mail arrives,
I want to get some information like the name of the sender, what is
the subject and body text?

How can I retrieve such properties from the incoming mail item?

I thought this was a good place to start...
Private Sub Application_NewMail()
....code...
End Sub

Any suggestions or code sample is very much apprieciated.


Regards
Jan.


Ads
  #2  
Old September 18th 06, 05:45 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Retrieving information from incomming mail items.

Am Sun, 17 Sep 2006 23:43:57 +0200 schrieb Jan G. Thorstensen:

NewMail fires only once for a bundle of messages. Instead you can use
ItemAdd, which fires for each message as long as there´re not more than 16
at once.

That event has an Item argument, which is a reference to the incoming
message. Simply read its SenderName (that´s the sender´s display name),
Subject and Body properties.

In OL 2000 there´s no way to read the Sender´s address directly. For that
you´d need CDO 1.21 or Redemption (www.dimastr.com).

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


I am using Outlook2k and WinXP. When a new mail arrives,
I want to get some information like the name of the sender, what is
the subject and body text?

How can I retrieve such properties from the incoming mail item?

I thought this was a good place to start...
Private Sub Application_NewMail()
...code...
End Sub

Any suggestions or code sample is very much apprieciated.


Regards
Jan.

 




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
error retrieving folder.items.count kappe79 Outlook and VBA 3 September 19th 06 01:29 PM
Reply to incomming mail problem carebear Outlook Express 1 August 16th 06 07:31 PM
how do i auto copy an incomming e-mail to a personal folder jeff65 Outlook - Installation 1 May 21st 06 09:35 AM
stokp out look from retrieving mail while off` sacredarms Outlook - General Queries 1 April 18th 06 03:02 AM
error 0x80040900 in outlook retrieving mail [email protected] Outlook - General Queries 5 February 15th 06 04:46 PM


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