Hi there
I've written a fairly basic outlook automation function to create an email containing the text of a textbox to a contact (held in another table). Intermitently (i.e. when my boos came over for a demonstration) I get errors on the line :
With out.CreateItem(olMailItem)
telling me there is an internal application error. Can anyone spot anything obviously wrong in this?
Very many thanks in advance...
blue skies
j.
'create a reference to an object and assign the object variable
'to an Outlook application, send the question and kill the outlook
'application
Dim out As Object
Set out = CreateObject("Outlook.Application")
With out.CreateItem(olMailItem)
.Recipients.Add (recContact("ContactEmail"))
'delete my company name
.Subject = "Question from ********** UK Ltd"
txtQuestion.SetFocus
.Body = txtQuestion.Text
.Send
End With
Set out = Nothing
MsgBox "Sent", vbOKOnly + vbInformation, "New Question"
I've written a fairly basic outlook automation function to create an email containing the text of a textbox to a contact (held in another table). Intermitently (i.e. when my boos came over for a demonstration) I get errors on the line :
With out.CreateItem(olMailItem)
telling me there is an internal application error. Can anyone spot anything obviously wrong in this?
Very many thanks in advance...
blue skies
j.
'create a reference to an object and assign the object variable
'to an Outlook application, send the question and kill the outlook
'application
Dim out As Object
Set out = CreateObject("Outlook.Application")
With out.CreateItem(olMailItem)
.Recipients.Add (recContact("ContactEmail"))
'delete my company name
.Subject = "Question from ********** UK Ltd"
txtQuestion.SetFocus
.Body = txtQuestion.Text
.Send
End With
Set out = Nothing
MsgBox "Sent", vbOKOnly + vbInformation, "New Question"