Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook attachments - where
Message
De
28/01/2013 14:24:16
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
28/01/2013 08:47:48
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Divers
Thread ID:
01564054
Message ID:
01564385
Vues:
44
Actually, if it wasn't outlook, but any normal client, which doesn't convert the incoming mail into a proprietary format, you'd see that all attachments are inline, in base64 format. I have even received .eml files with such attachments inline, and didn't even bother to import them into my web client - opened the .eml (which is just text) in VFP's editor, found where it begins with
--------------020407090109010406090106
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
Content-ID: <part1.01070905.00040907@ndragan.com>

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8S
EhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEU
Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wgAR
CAHgAoADASIAAhEBAxEB/8QAHAAAAgMBAQEBAAAAAAAAAAAAAwQBAgUGAAcI/8QAGQEAAwEB
and copied the encoded lines to the clipboard. Then in Fox I just did strtofile(strconv(_cliptext, 14), "something.jpg") and got exactly the same image as was in the email. Sometimes I took it from one of the larger files (my email archives go between 800M and 1,5G a year), no problem.

Now with Outlook, good luck finding where the attachment is. It may be accessible through the DOM, i.e. via automation. I've found something (based on, IIRC, Brandon Harker's CDO classes) that I did in 2001... and it's cumbersome. You first have to dive through outlook.namespace, then iterate through its InfoStores, then in each to iterate through folders collection (recursively, as there can be folders inside folders), then in there you'd find items, which are email messages (or other outlook items, like tasks, meetings etc), and then in a message, iterate through .attachments collection, and then there's a .SaveAsFile(tcFileName) method of the attachment object.

Knowing the hierarchy of names, of course, you may not need to iterate through the whole tree, but go straight for the branch you need.

>Thanks
>
>
>>Any attachment is a part of email itself.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform