Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook Add-In/Macro To Save Email/Attachments
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01577998
Message ID:
01578001
Vues:
77
>Hi
>
>I need a macro/add-in that'll allow me to save an email/attachments, from within Outlook, to a specified location on disk. The user would need to enter a reference number, which I'd then use to build the filenames, so that what VFP reads this directory it knows which Case/Matter the email/attachments refer to.
>
>The process has to be driven from Outlook, I can already access the Outlook object from VFP but that's of no use in this instance as the process has to be driven from Outlook.
>
>I've Googled until I'm blue in the face but I just seem to go around to the same old examples that aren't what I need. Any help/assistance would be gratefully received.
>
>Regards
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform