>>>>How can I save outlook messages as text files
>>>
>>>Use Automation and the SaveAs method of the MailItem object.
>>>
>>>Tamar
>>
>>Thanks for that but I am afraid i don't understand what you are getting at
>>
>>What is Automation in this context and what is the Mailitem object?
>>
>>Can you please give me an example in use
>
>You can automate Outlook, like this:
>
>
>LOCAL oOutlook, oNS, oInbox, oItem
>oOutlook = createobject('Outlook.Application')
>oNS = oOutlook.GetNameSpace('MAPI')
>
>oInbox = oNS.GetDefaultFolder[6]
>
>* Assuming you want the last item
>oItem = oInbox.Items[oInbox.Items.Count]
>
>* assumes you already set up name of output file in cFileWithPath
>oItem.SaveAs(cFileWithPath, 0)
>
>
>MailItem is the name of the class in Outlook used for individual emails.
>
>Tamar
Tamar - thanks
My code
cFileWithPath="m:\outlook\dax"
LOCAL oOutlook, oNS, oInbox, oItem
oOutlook = createobject('Outlook.Application')
oNS = oOutlook.GetNameSpace('MAPI')
oInbox = oNS.GetDefaultFolder[6] && 6 is the main Inbox folder
* Assuming you want the last item
oItem = oInbox.Items[oInbox.Items.Count]
* assumes you already set up name of output file in cFileWithPath
oItem.SaveAs(cFileWithPath, 0) && 0 is txt type
This comes up with an error on the last line Parameter no Optional
Any ideas
Thanks
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing