Outlook email information reader/extractor

Hi,

I have a server that emails me some a couple of numbers, whenever an assembly process changes.  The emails are always in the same format.  I would like to run a macro in Outlook that would extract some of the numbers in the email, and put them into an excel spreadsheet.  How would I go about having a macro read an email to extract some numbers.

Thanks for your help!



Answer this question

Outlook email information reader/extractor

  • SimonB1965

    Per the support engineer:

    The Partner can use MailItem object in Outlook VBA. We can use this object to get each mail object, then use HTMLBody property to get the email content. This should be easy.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    This is the reference for this object.

    Represents a mail message in an Inbox (mail) folder.

    Using the MailItem Object

    Use the CreateItem method to create a MailItem object that represents a new mail message. The following example creates and displays a new mail message.

    Set myOlApp = CreateObject("Outlook.Application")

    Set myItem = myOlApp.CreateItem(olMailItem)

    myItem.Display

                                   

    Use Items (index), where index is the index number of a mail message or a value used to match the default property of a message, to return a single MailItem object from an Inbox folder. The following example sets the current folder as the Inbox and displays the second mail message in the folder.

    Set myOlApp = CreateObject("Outlook.Application")

    Set myNamespace = myOlApp.GetNamespace("MAPI")

    Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)

    myFolder.Display

    Set myItem = myFolder.Items(2)

    myItem.Display

                                   

    Remarks

    If a program tries to reference any type of recipient information by using the Outlook object model, a dialog box is displayed that asks you to confirm access to this information. You can allow access to the Address Book or recipient information for up to ten minutes after you receive the dialog box. This allows features, such as mobile device synchronization, to be completed.

    You receive the confirmation dialog box when a solution tries to programmatically access the following properties of the MaiItem object:

    SentOnBehalfOfName

    SenderName

    ReceivedByName

    ReceivedOnBehalfOfName

    ReplyRecipientNames

    To

    CC

    BCC

    Body

    HTMLBody

    Recipients

    SenderEmailAddress


    -brenda (ISV Buddy Team)



  • Outlook email information reader/extractor