Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a LOG file from Inbox list of MsOutlook

Status
Not open for further replies.

luckyluci

Structural
Joined
Aug 21, 2001
Messages
13
Location
RO
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!
 
You can write a macro in Outlook VBA. This should get you started:

Code:
Private Sub Application_NewMail()
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:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top