Results 1 to 2 of 2

Thread: VBA - Outlook 2007 - New Mail

  1. #1

    Thread Starter
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068

    VBA - Outlook 2007 - New Mail

    What I am trying to do is get information on a new message when it arrives, I need the subject line most importantly and the Body, second most importantly.


    Has anyone done this before?
    Thoinks

  2. #2
    Addicted Member
    Join Date
    Apr 2009
    Location
    Toronto, Ontario
    Posts
    242

    Re: VBA - Outlook 2007 - New Mail

    You need to look into the MailItem object and the Application_NewMailEx event in the VBA help. The Application_NewMailEx event is fired every time you receive a message and it's parameter is a collection of the received messages. The MailItem object has the Subject and Body properties you're looking for.
    Remember you will need to check the arriving message to determine if it is a MailItem or not before accessing the Subject and Body properties, or you may get a runtime error.

    Good luck.
    -EM
    ---
    REMEMBER: If your issue is resolved, use the Thread Tools menu to set it as such, and be sure to rate the posts that help you the most!


    Just because I was jealous of g4hsean!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width