By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,226 Members | 1,435 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,226 IT Pros & Developers. It's quick & easy.

How to send a picture with outlook via access

P: n/a
I am using following code to send email
How can I use the .body or .htmlbody to insert a picture in the body of
ms outlook.
Outlook makes provision for sending pictures. If you are in the body you
click on insert and the picture option is then available. Thus I suppose you
can also do it via code
Thanks for help

Dim olApp As Outlook.Application
Dim olMailMessage As Outlook.MailItem
Dim olRecipient As Outlook.Recipient
Dim olAttach As Outlook.Attachment
Dim emailstring As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set cn = CurrentProject.Connection

Set rs = cn.Execute("SELECT DbGeneralEmail from DbMaster1 ")

Dim AttachmentPath As String
AttachmentPath = "c:\aa\customers.txt"

emailstring = " "
' Do Until rs.EOF
' If Not IsNull(rs!DbGeneralEmail) Then
' emailstring = emailstring + rs!DbGeneralEmail + ";"
emailstring = emailstring + "aj*******" + ";"
Set olApp = New Outlook.Application
Set olMailMessage = olApp.CreateItem(olMailItem)
With olMailMessage
.To = emailstring
.BCC = emailstring
.Subject = " tst subj " 'Me!txtSubject
.Body = Me!txtBody & vbCrLf & vbCrLf ''' want to insert
picture here or html file
.HTMLBody = p
' .Links

.Importance = olImportanceHigh 'High importance

If Not IsMissing(AttachmentPath) Then
Set olAttach = .Attachments.Add(AttachmentPath)
End If
End With
Set olMailMessage = Nothing
emailstring = " "
' End If
' rs.MoveNext
' Loop

End Sub
Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.