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!

Attachment Hell

Status
Not open for further replies.

T8JGT

IS-IT--Management
Feb 2, 2005
19
0
0
GB
i have a piece of code which develops an email in outlook, it worls great. BUT i need the attachment to be in the body of the email.

Any Suggestions (code below).


Private Sub cmdSend_Click()
Dim strEmail, HTML As String
Dim objOutlook As Object
Dim objEmail As Object

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

strEmail = txtEmail
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<body bgcolor=""#FFFFFF"">"
HTML = HTML & "<P><font size=""3"" face=""Optima"">"
HTML = HTML & ITSQFDocumentName & " received from " & ProjectServiceDesigner & _
":" & "<Strong>" & " '" & ProjectName & "'" & "</Strong>" & "- PAR "
If IsNull(ProjectPAR) Then
HTML = HTML & "TBA " & Chr(13) & "<BR>"
Else
HTML = HTML & ProjectPAR & Chr(13) & Chr(13) & "<BR>"
End If
If Not IsNull(ProjectLiveDate) Then
HTML = HTML & "Go Live " & ProjectLiveDate & Chr(13) & "<BR></P>"
End If
HTML = HTML & "<P>" & ProjectSummary & Chr(13) & "</P>"
HTML = HTML & "<P>" & ITSQFServRecommendation & Chr(13)
HTML = HTML & ITSQFQualityGate & Chr(13)
If Not IsNull(ITSQFList) Then
HTML = HTML & "with the following points to note:" & Chr(13) & "<BR>"
End If
HTML = HTML & ITSQFList & Chr(13) & "<BR> </P>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
objEmail.HTMLBody = HTML

'***creates and sends email
With objEmail
.To = ITSQFEmail
.CC = "email@email.com"
.Subject = "ITSQF Submission"
.HTMLBody = HTML
.Attachments.Add (ITSQFDocumentAddress)
.Send
End With


Set objEmail = Nothing

DoCmd.Close


End Sub
 
I might be wrong but as far as I know when using a HTML message format it doesn't support attachments as part of the e-mail body.

Why do you need to do this rather than just send the attachment as is??

Cheers

Harleyquinn

---------------------------------
For tsunami relief donations
 
The reason is it is company policy to send in this format as it is copied into my differend documents.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top