I use VBA to some extent using this code:
Sub ExtractEmail() Dim OlApp As Outlook.Application Dim Mailobject As Object Dim Email As String Dim NS As NameSpace Dim Folder As MAPIFolder Set OlApp = CreateObject("Outlook.Application") ' Setup Namespace Set NS = ThisOutlookSession.Session ' Display select folder dialog Set Folder = NS.PickFolder ' Create Text File Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("c:\mydocuments\emailss.txt", True) ' loop to read email address from mail items. For Each Mailobject In Folder.Items Email = Mailobject.To a.WriteLine (Email) Next Set OlApp = Nothing Set Mailobject = Nothing a.Close End Sub
However, this gives the output as the names of email addresses, rather than the actual email address using " something@this.domain " .
Is there a mail object attribute that allows email addresses, not names, to be written in the 'To' text box.
thanks
source share