Hi
I'm a teacher and I'm hoping to be able to create some vba code in Excel so that parents can be automatically emailed with information. But when my code attempts to create an Outlook.Application object I get the following error message:
"User defined type not defined"
I have gone to references looking for a type library for outlook but there doesn't seem to be one. The code I'm using is below:
Dim OutMail As Object
Dim OutApp As Outlook.Application
Set OutApp = New Outlook.Application
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Parent Data").Range("E4")
.CC = ""
.BCC = ""
.Subject = Sheets("Parent Data").Range("A2")
.Body = Sheets("Parent Data").Range("A3")
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
Can anyone help me?
Thanks
Briano216
I'm a teacher and I'm hoping to be able to create some vba code in Excel so that parents can be automatically emailed with information. But when my code attempts to create an Outlook.Application object I get the following error message:
"User defined type not defined"
I have gone to references looking for a type library for outlook but there doesn't seem to be one. The code I'm using is below:
Dim OutMail As Object
Dim OutApp As Outlook.Application
Set OutApp = New Outlook.Application
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Sheets("Parent Data").Range("E4")
.CC = ""
.BCC = ""
.Subject = Sheets("Parent Data").Range("A2")
.Body = Sheets("Parent Data").Range("A3")
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
Can anyone help me?
Thanks
Briano216