Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving outlook text files
Message
 
To
18/06/2012 15:31:34
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01546194
Message ID:
01546280
Views:
49
>>>>How can I save outlook messages as text files
>>>
>>>You could try this:
>>>
>>>
>>>o = createobject("outlook.application")
>>>For i = 1 To o.activeexplorer.currentfolder.Items.Count
>>>        try
>>>             o.activeexplorer.currentfolder.Items(i).saveas("Filename" + str(i) + ".txt")
>>>        catch 
>>>        end try       
>>>    Next i
>>>End Sub
>>>
>>>
>>>Have not tried the exact code in vfp, but it's translated from outlook vba that does work. I'm assuming the saveas method works as tamar indicated.
>>>
>>>I'm assuming you wish to save all the emails in the current outlook folder as text in the folder on your disk. You could always handle where it's saved in the filename.
>>>
>>>Hope this helps.
>>
>>Thanks
>>

Thanks Dragan

But the code below creates no text files in the folder - Outlook is running and there are 2 emails in the inboc

CLEAR ALL
CLEAR
o = createobject("outlook.application")
For i = 1 To o.activeexplorer.currentfolder.Items.Count
try
o.activeexplorer.currentfolder.Items(i).saveas("m:\outlook\dax" + str(i) + ".txt")
catch
endtry
Next i
>>But the code
>>
>>o = createobject("outlook.application")
>>
>>For i = 1 To o.activeexplorer.currentfolder.Items.Count
>> try
>> o.activeexplorer.currentfolder.Items(i).saveas("Filename" + str(i) + ".txt")
>> catch
>> end try
>> Next i
>>End Sub
>>
>>Gives me a nesting error
>
>In Fox, it's "ENDTRY" (as one word).
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