Sunday, 15 September 2013

VBA Code - Extract email addresses Outlook -


I got the code VBA code to remove email addresses from PST files. This is very useful because I can choose to remove addresses from folders. The code is being removed from the " to " area.

I need this to remove from Message Body and " to " field.

What should I change in the code?

  sub-extractEmail () Dim OlApp Outlook.Application Dim as the object name as Dimmobject set as the numeric dim FolderMAPIFolder set in the form of string retarded Ns OlApp = CreateObject (" Setup Namespace Setup Ns = ThisOutlookSession.Session 'Display Folder Folder Folder = NS.PickFolder' Set Text File Fs = CreateObject Set ("Scripting. FileSystemObject") Set a = fs. CreateTextFile ("c: \ email addresses.txt", is true) to read the email address from the mail item Par. In the folder for each mailbox. Item email = mailboxes Set up for A.WriteLine (email) OlApp = Set nothing Mailobject = None. Close End Sub   

Thank you.

You have mail item objects so use it to get the fields. Mailobject.Sender, Mailobject.SenderEmailAddress, Mailobject.SenderName and Mailobject.Body, Mailobject.HTMLBody or Mailobject.RTFBody A ???? Sorceri

You are going to extract the value of the property, whcih a ";" A separate list of recipient names requires you to loop through each item in MailItem.Recipients.Collection.Collection and read the recipients for each recipient.Additional property A ???? Dmitry Strailechenko



No comments:

Post a Comment