Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook 2003 attachments
Message
 
To
08/10/2004 01:19:06
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00949797
Message ID:
00949823
Views:
23
Here is an Outlook solution
Local lcFilename,lcPath
lcPath='c:\savedattachments\'
If  !Directory('c:\savedAttachments')
    Md 'c:\savedAttachments' && Create the directory if it doesn't exist.
Endif
oOutLookObject = Createobject('Outlook.Application')
olNameSpace = oOutLookObject.GetNameSpace('MAPI')
myAtts=olNameSpace.GetDefaultFolder(olFolderInbox).Items
For Each loItem In myAtts
    If loItem.attachments.Count >0 && Make sure there is an actual attachment.
        For i = 1 To loItem.attachments.Count
            lcFilename=''
            lcFilename = loItem.attachments.Item(i).filename
            lcFilename = Alltrim(lcPath)+lcFilename
            loItem.attachments.Item(i).SaveAsFile(lcFilename)
           *loItem.Delete() && The option to delete the message once the attachment has been saved.
        Next
    Endif
Next
>Hi, all
>
>I have lots of email messages in one outlook folder. Every message has 2 attachments (2 .txt files). I need to save all attachments in some folder from VIsualFoxPro (7,8), or is it maybe better solution to use some export from outlook?
>
>TIA
>Goran
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform