Hi,
Following is the code that I use to create object of Outlook. I have not set references since I want it to work with all versions of Outlook. But the .CreateItem method produces error. Following is the code:
Dim objOutlook As Object
Dim objOutlookMsg As Object
On Error GoTo Err_Hnd
'Instantiate an Outlook Application object.
Set objOutlook = CreateObject("Outlook.Application")
'Below line produces error!
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
objOutlookMsg.To = txtEmailID.Text
objOutlookMsg.Display
Any help?
Regards,
VJ
Following is the code that I use to create object of Outlook. I have not set references since I want it to work with all versions of Outlook. But the .CreateItem method produces error. Following is the code:
Dim objOutlook As Object
Dim objOutlookMsg As Object
On Error GoTo Err_Hnd
'Instantiate an Outlook Application object.
Set objOutlook = CreateObject("Outlook.Application")
'Below line produces error!
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
objOutlookMsg.To = txtEmailID.Text
objOutlookMsg.Display
Any help?
Regards,
VJ