How about copying all the messages in the folders and pasting them into an
Excel spreadsheet? You'll see the same view fields replicated as column
headers and it should just like the message list.
Otherwise, you can use something like this:
Sub OutputSelectedMessagesToExcel()
Dim myOlExp As Outlook.Explorer
Dim MyOlsel As Outlook.Selection
Dim objItem As Object
Dim objWkb As Object 'Excel.Workbook
Dim objWks As Object 'Excel.Worksheet
Dim objExcel As Object 'Excel.Application
Dim i As Integer, j As Integer
Set myOlExp = Application.ActiveExplorer
Set MyOlsel = myOlExp.Selection
'Set objExcel = New Excel.Application
Set objExcel = CreateObject("Excel.Application")
Set objWkb = objExcel.Workbooks.Add
Set objWks = objExcel.ActiveSheet
objWks.Cells(1, 1).Value = "Subject"
objWks.Cells(1, 2).Value = "Received"
objWks.Cells(1, 3).Value = "Sender Name"
objWks.Cells(1, 4).Value = "Email"
For i = 1 To MyOlsel.Count
Set objItem = MyOlsel.Item(i)
objWks.Cells(i + 1, 1).Value = objItem.Subject
objWks.Cells(i + 1, 2).Value = objItem.ReceivedTime
objWks.Cells(i + 1, 3).Value = objItem.SenderName
objWks.Cells(i + 1, 4).Value = objItem.SenderEmailAddress
Set objItem = Nothing
Next
objExcel.Visible = True
Set objWks = Nothing
Set objExcel = Nothing
Set objWkb = Nothing
Set myOlExp = Nothing
Set MyOlsel = Nothing
End Sub
--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog:
http://blogs.officezealot.com/legault/
"Varun Nair" wrote:
HI,
My agents receive data in their mail boxes and i need to calculate their
Cycletime on each mail. SO i want to track the mails in their inbox and sent
items.
I was looking for a macro which could generate an excel sheet which contians
all the information of mails in my inbox.
Information as in Subject, Sender etc.
--
Varun Nair