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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top