Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving outlook text files
Message
 
To
18/06/2012 13:17:37
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01546194
Message ID:
01546270
Views:
50
>>>>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]  && 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
>
>
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform