Hi
I am using the following VB to email information. This code works at home but fails at work with a 'Run Time Error 287' 'Application Defined or object-defined error'
It fails at .Recipients.Add "[email protected]"
The only thing I can think of is some security issue with the macro. But all seems in order.
Can anyone help?
Heres the code
Code
Dim olapp As Object
Dim olmail As Object
Set olapp = CreateObject("outlook.application")
Set olmail = olapp.createitem(0)
With olmail
.Subject = "Info: " & Sys & " - " & Des & " "
.Recipients.Add "[email protected]"
.body = TextBox1.Value
.attachments.Add 'reference any attachement
.send
End With
Set olmail = Nothing
Set olapp = Nothing
Display More
Thanks in advance.
SF