I have an Access application that I want to send an email with. I can get it to work but only if outlook is already open. If it is not I get an internal application error. Below is the code:
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim txtRecipient As String
Dim stappname As String
Dim myNameSpace
On Error GoTo HandleErr
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application"
'Set myNameSpace = objOutlook.GetNamespace("MAPI"
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
On the last line is where I get the error. I am curious if this is a system setting or a missed reference. Can anyone shed some light on this subject.
Thanks,
Doug
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim txtRecipient As String
Dim stappname As String
Dim myNameSpace
On Error GoTo HandleErr
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application"
'Set myNameSpace = objOutlook.GetNamespace("MAPI"
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
On the last line is where I get the error. I am curious if this is a system setting or a missed reference. Can anyone shed some light on this subject.
Thanks,
Doug