Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Manipulating Outlook Attachments
Message
 
To
27/09/2005 17:32:59
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01053664
Message ID:
01053842
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
Here is an example that answers 2 of your 3 questions (putting a reference I don't know)
#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).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.attachments(i).delete()
        Next
    Endif
Next
>Is there a way to not only save email attachments but to delete them from the email without actually deleting the email? Also, is it possible to put a reference to the location of the attachment back in the body of the email?
>
>Hope this makes sense!
>
>Thanks in advance for your help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform