this routine saves a msg as txt, can it be modified to save as an xls file?

F

fitful_thought

Sub SaveAsPlainText()
Set myolapp = CreateObject("Outlook.Application")
Set myItem = myolapp.ActiveInspector
If Not TypeName(myItem) = "Nothing" Then
Set objItem = myItem.CurrentItem
objItem.SaveAs "C:\message.txt", olTXT
Else
MsgBox "There is no current active Inspector."
End If

End Sub
 
D

Dmitry Streblechenko \(MVP\)

No, you will need to create an instance of the Excel.Application object and
drive it in your code to create a worksheet, populate its cells and save it
to a file.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Top