Create a LOG file from Inbox list of MsOutlook
Create a LOG file from Inbox list of MsOutlook
(OP)
I want to create an LOG file using the structure "From, Subject, Received Date" from MsOutlook software INBOX, as you could see if you tray to print the panel with option "File>Print>Table Style>all rows>Preview". How shall I proceed?
Otherwise I should copy & paste from each email the above-mentioned values to an excel file, and is a lot of work!!!
Thank you!
Otherwise I should copy & paste from each email the above-mentioned values to an excel file, and is a lot of work!!!
Thank you!





RE: Create a LOG file from Inbox list of MsOutlook
CODE
Dim MI As MailItem
Dim MF As MAPIFolder
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("c:\test.txt", 8, 0)
Set MF = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
For Each MI In MF.Items
f.Write MI.SenderName & " " & MI.Subject & " " & MI.ReceivedTime & vbCrLf
Next
f.Close
End Sub
This still needs some work, and it assumes the existence of the text file. It's currently fired when a new email arrives, but should be enough to get you started.
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
UK steam enthusiasts: www.essexsteam.co.uk