JohnPeasley
Registered User.
- Local time
- Today, 18:29
- Joined
- Nov 28, 2016
- Messages
- 10
I need to send an outlook template as an email from Access. When I use the code below it hangs up at “CreateItemFromTemplate” and I keeping an error message - “Compile Error: Method or data member not found.”
I have the following references checked: Microsoft Access 14.0 Object Library; Microsoft Outlook 14.0 Object Library; Visual Basic for Applications; OLE Automation; Microsoft Office 14.0 Access Database Engine Object Library; Microsoft Scripting Runtime.
Any help would be greatly appreciated
Private Sub Create_Email_Click()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
'Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With Outlook.Application
'Create the message.
Set objOutlookMsg = Application.CreateItemFromTemplate("C:\Documents\templates\Rejects.oft")
.Display
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
I have the following references checked: Microsoft Access 14.0 Object Library; Microsoft Outlook 14.0 Object Library; Visual Basic for Applications; OLE Automation; Microsoft Office 14.0 Access Database Engine Object Library; Microsoft Scripting Runtime.
Any help would be greatly appreciated
Private Sub Create_Email_Click()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
'Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With Outlook.Application
'Create the message.
Set objOutlookMsg = Application.CreateItemFromTemplate("C:\Documents\templates\Rejects.oft")
.Display
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Last edited: