tangteng78
asked on
How to get image attached in the body of email in outlook?
Hi,
I want to get the body of an email including the texts and photo/image attached in the body.
I'm able to get the body of the email using the mailObject.Body property, but it doesn't seem to be able to get the photo/image.
Any advise is greatly appreciated.
I want to get the body of an email including the texts and photo/image attached in the body.
I'm able to get the body of the email using the mailObject.Body property, but it doesn't seem to be able to get the photo/image.
Any advise is greatly appreciated.
Dim inBox As Outlook.MAPIFolder
Dim Mailobject As Object
Set inBox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
Set InboxItems = inBox.Items
For Each Mailobject In InboxItems
If Mailobject.UnRead Then
'I can get the body of the email by setting as below.
Dim strBody as string
strBody = Mailobject.Body
'...but i can NOT get the photo attached in the body
End If
Next
how-to-get-photo-from-email.bmp
I think you need to use Mailobject.attachments. See http://www.access-programmers.co.uk/forums/showthread.php?t=179942
ASKER
I want to get the photo programatically using VBA.
tangteng78, the link I sent you has code for VBA... do you need help interpreting it?
ASKER
Is there a way to know at which point the photo is located in the email body when i save it?
Example:
--------------------------
text 1
photo 1
text 2
photo2
--------------------------
Rather than just saving photo 1 and photo 2, but i want to know that photo 1 is beween text 1 and text 2, while photo 2 is after text 2.
Example:
--------------------------
text 1
photo 1
text 2
photo2
--------------------------
Rather than just saving photo 1 and photo 2, but i want to know that photo 1 is beween text 1 and text 2, while photo 2 is after text 2.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
quizwedge,
No luck. It doesn't provide me how to get the exact location of the embedded photo/image in the body :((
Any ideas?
No luck. It doesn't provide me how to get the exact location of the embedded photo/image in the body :((
Any ideas?
Can you post what the HTMLBody property returns? I'm a VB.NET programmer and not really set up to do VBA for Outlook.
Refer this:
http://www.velocityreviews.com/forums/t217773-outlook-2003-view-attached-images-in-body-of-email.html
I hope this helps,
Shree