Hi
I'm using the code below to create an e-mail. It worked fine, but then I added a line regarding attachments (in bold below) which I'd seen in other threads in these forums. I now get a message "Object doesn't support this property or method" in relation to the attachment line. Any advice would be greatly appreciated.
Thanks
AL
I'm using the code below to create an e-mail. It worked fine, but then I added a line regarding attachments (in bold below) which I'd seen in other threads in these forums. I now get a message "Object doesn't support this property or method" in relation to the attachment line. Any advice would be greatly appreciated.
Thanks
AL
Code:
Private Sub fremail_Click()
Dim appOutlook As Outlook.Application
Dim ItmNewEmail As Outlook.MailItem
Dim TemplateName As String
Dim strBody As String
Dim attname As String
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'save record before proceeding
TemplateName = "c:\Internal audit\E-mail templates\draft report e-mail.oft"
attname = Forms![frm recs tracked jobs]![File Ref] & "\" & Forms![frm recs tracked jobs]![Job] & " Action Plan.snp"
Set appOutlook = New Outlook.Application
Rem Set ItmNewEmail = appOutlook.CreateItem(olMailItem)
Set ItmNewEmail = appOutlook.CreateItemFromTemplate(TemplateName)
strBody = strBody & Chr(13) & Chr(10)
strBody = strBody & "As discussed please find attached the Draft Report for the " & Forms![frm recs tracked jobs]!Job & " audit. I would appreciate it if you could complete the On-line Action Plan by " & Forms![frm recs tracked jobs]![Response Due By] & "." & Chr(13) & Chr(13)
strBody = strBody & "I would like to thank you and your staff for the help and co-operation received during the audit." & Chr(13) & Chr(13)
strBody = strBody & "If you require any further information, please contact me." & Chr(13) & Chr(13)
With ItmNewEmail
.To = Forms("frm recs tracked jobs").Controls("Contact").Value
.CC = "Michael Watson"
.Subject = Forms("frm recs tracked jobs").Controls("job").Value & " IA Inspection - Final Report"
.Body = strBody
.BodyFormat = olFormatHTML
[b].Attachment = "i:\arts development\arts development action plan.snp"[/b]
.Display
End With
End Sub