CarlRostron
Registered User.
- Local time
- Today, 05:18
- Joined
- Nov 14, 2011
- Messages
- 88
I have tried both early & late binding. There must be something wrong here somewhere I am convinced the code is correct:
Attached are the references I have set.
I either get the 'ActiveX component can't create object' error with the above code, or if I use early binding I get a type mismatch error on line:
Please help.
Code:
Option Explicit
Sub EmailClient()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
'DO HERE
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
Attached are the references I have set.
I either get the 'ActiveX component can't create object' error with the above code, or if I use early binding I get a type mismatch error on line:
Code:
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Please help.
Attachments
Last edited: