Hi
I use the code below to create an e-mail from Access. The e-mail template contains a signature, but the strBody text inserted after the signature rather than before it. I know I can manually drag the text up before the signature, but is there a way of automatically putting it at the start of the e-mail?
Thanks
AL
I use the code below to create an e-mail from Access. The e-mail template contains a signature, but the strBody text inserted after the signature rather than before it. I know I can manually drag the text up before the signature, but is there a way of automatically putting it at the start of the e-mail?
Thanks
AL
Code:
Private Sub msqemail()
Dim appOutlook As Outlook.Application
Dim ItmNewEmail As Outlook.MailItem
Dim TemplateName As String
Dim strBody As String
Dim attnameDR As String
Dim attnameAP As String
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'save record before proceeding
Rem TemplateName = "c:\Internal audit\E-mail templates\draft report e-mail.oft"
TemplateName = "i:\ia manual\e-mail templates\drtemp1.oft"
attnameDR = Forms![frm recs tracked jobs]![docfolder] & "\" & Forms![frm recs tracked jobs]![Job] & " MSQ.doc"
Set appOutlook = New Outlook.Application
Set ItmNewEmail = appOutlook.CreateItemFromTemplate(TemplateName)
strBody = strBody & Chr(13) & Chr(10)
strBody = strBody & Forms![frm recs tracked jobs]![ManagerFirstName] & Chr(13) & Chr(13)
strBody = strBody & "Further to the issue of the " & Forms![frm recs tracked jobs]!Job & " Final Report, please find attached a Management Satisfaction Questionnaire. The purpose of this is to allow you to give us your views on the service we provide and helps us to monitor the quality of our serivce. I'd be grateful if you could complete this questionnaire and return it to me as soon as possible." & Chr(13) & Chr(13)
strBody = strBody & "If you have any queries, please contact me." & Chr(13) & Chr(13)
strBody = strBody & "Thanks" & Chr(13) & Chr(13)
With ItmNewEmail
.To = Forms("frm recs tracked jobs").Controls("contact").Value
.Subject = Forms("frm recs tracked jobs").Controls("job").Value & " IA Inspection - Management Satisfaction Questionnaire"
.Body = strBody
.BodyFormat = olFormatHTML
.Attachments.Add attnameDR
.Display
End With
End Sub