View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default Outlook - Object Model Guardian


Redemption is the best solution I know of. It provides a DLL that
exposes a copy of the Outlook object model but one without an object model
guard. It's free for development/personal use and $199 for a redistributable
version.

http://www.dimastr.com/redemption/

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

"Braindeadbeachbum" wrote in
message ...
Hi Guys

I'm running Office 2003 and need to automate the sending of a notification
e-mail to myself when ever my code receives and error. I used the
following
code but this screen keeps popping up saying: A program is trying to
automatically send e-mail on your behalf. Do you want to allow this?...

I think it's the "Outlook - Object Model Guardian" requesting this
confirmation.

Is there any work around as this e-mail needs to go out without any human
interaction?

Private Sub SendErrorEmail()
Dim objOutlook As New Outlook.Application
Dim objMail As MailItem
Dim strMessage As String

Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem(olMailItem)

strMessage = "Jan," & Chr(13) & Chr(13)
strMessage = strMessage & "This is just a test." & Chr(13) & Chr(13)
strMessage = strMessage & "Cheers. Jan"

With objMail
.To = "
.Subject = "Testing"
.Body = strMessage
.Display
.Send
End With

Set objMail = Nothing
Set objOutlook = Nothing

End Sub

Please help!!