Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook 2003 attachments
Message
 
To
08/10/2004 06:54:22
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00949797
Message ID:
00950139
Views:
17
If you ptt folder has an index of 1 (The index depends if it was the first one to be created in you inbox) you would use this:
#DEFINE olFolderInBox 6

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).folders(1).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
>OK,
>
>I found in objectbrowser (olFolderInbox = 6), but I need to use subfolder "ptt" (subfolder of inbox in outlook)
>
>Goran
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform