Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to create an EMAIL to show attachment as thumbnail

Status
Not open for further replies.

jase2006

Technical User
Nov 17, 2006
53
0
0
GB
Hi, can anyone please tell me how I can format an email using ACCESS VBA to show an attachment as thumbnail in the Body?? Thanks.
 
What kind of attachment is it?

And what have you tried so far?



Ignorance of certain subjects is a great part of wisdom
 
You may wish to look at the arguments for Add.
 
I've attached a jpeg as the attachment. This is the code:

Dim otl
Dim mal
Dim olMailItem

Set mal = otl.CreateItem(olMailItem)

with mal
.To = xxxx@hotmail.com
.Subject = "A new picture"
.Body = "emailMSG"
.Attachments.Add "C:\pic1.jpg", 1, 1, "pic1"
.Importance = 2
.DeferredDeliveryTime = DateAdd("n", 60, Now())
.Send

End With

Set mal = Nothing
Set otl = Nothing
 
attachments are generally formatted by the email sending program i think...not sure you can have control.

Foe example Outlook put s all attachments in the "Attachments line" but Lotus Notes will put the attachments inside the message body...



Hope this helps!

Regards

BuilderSpec
 
You may find something useful in thread705-1367295, which was concerned with Office 2000, there are differences between the versions.

How an item appears also depends on whether the email is plain text or rich text
 
Alright, is there a using HTML email to do this with an attachment. If yes, please supply some code. Thanks
 
Please look at the thread I posted. It has code.
 
Thanks Remou that really helped. One more problem, the email generate doesn't include my email signature. Is there a way to get it in automatically?
 
According to Ron de Bruin ( signatures are saved in:

C:\Documents and Settings\" & Username & _
"\Application Data\Microsoft\Signatures\

As HTML, TXT and RTF. You can read in the HTML file as illustrated in the thread I posted or you can use Ron de Bruin's code with a little modification.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top