Help!

Outlook 2003 alert problem

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  Editing Voting Responses  
Author Message
Henry
External


Since: Jun 18, 2007
Posts: 4



PostPosted: Mon Apr 27, 2009 1:10 pm    Post subject: Outlook 2003 alert problem
Archived from groups: microsoft>public>outlook>program_vba (more info?)

How can I turn Outlook alerts off?

When I try to send an email from my Excel VBA program I get the following
alert.
"A program is trying to automatically send e-mail on your behalf. Do you
want to allow this?"
Yes, No or Cancel.

Is there a way to either turn off the alert or automatically answer Yes.

Relevent part of program:
---------------------------------------------
Set appOL = CreateObject("Outlook.Application")
Set appMess = appOL.CreateItem(olMailItem)

For cnt = 1 To 99
If ISLIKE(Cells(cnt, 12).Value, "*@*") Then 'does cell contain email
address?
appMess.To = "Valid.e-mail@address"
appMess.Subject = "tester"
appMess.Body = "test"
appMess.Send <------ this causes alert to show

End If
Next cnt

appMess.Quit
appOL.Quit
Set appOL = Nothing
Set appMess = Nothing

---------------------------

Henry
Back to top
Sue Mosher [MVP]
External


Since: Mar 19, 2009
Posts: 41



PostPosted: Mon Apr 27, 2009 1:45 pm    Post subject: Re: Outlook 2003 alert problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

See http://www.outlookcode.com/article.aspx?ID=52 for your options with
regard to the "object model guard" security.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Henry" <henry.best DeleteThis @no_way.com> wrote in message
news:jCkJl.80591$vI1.16253@newsfe14.ams2...
> How can I turn Outlook alerts off?
>
> When I try to send an email from my Excel VBA program I get the following
> alert.
> "A program is trying to automatically send e-mail on your behalf. Do you
> want to allow this?"
> Yes, No or Cancel.
>
> Is there a way to either turn off the alert or automatically answer Yes.
>
> Relevent part of program:
> ---------------------------------------------
> Set appOL = CreateObject("Outlook.Application")
> Set appMess = appOL.CreateItem(olMailItem)
>
> For cnt = 1 To 99
> If ISLIKE(Cells(cnt, 12).Value, "*@*") Then 'does cell contain
> email address?
> appMess.To = "Valid.e-mail@address"
> appMess.Subject = "tester"
> appMess.Body = "test"
> appMess.Send <------ this causes alert to show
>
> End If
> Next cnt
>
> appMess.Quit
> appOL.Quit
> Set appOL = Nothing
> Set appMess = Nothing
>
> ---------------------------
>
> Henry
>
Back to top
Henry
External


Since: Jun 18, 2007
Posts: 4



PostPosted: Mon Apr 27, 2009 4:10 pm    Post subject: Re: Outlook 2003 alert problem [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks Sue.

Sue Mosher [MVP] wrote:
> See http://www.outlookcode.com/article.aspx?ID=52 for your options
> with regard to the "object model guard" security.
>
> "Henry" <henry.best.TakeThisOut@no_way.com> wrote in message
> news:jCkJl.80591$vI1.16253@newsfe14.ams2...
>> How can I turn Outlook alerts off?
>>
>> When I try to send an email from my Excel VBA program I get the
>> following alert.
>> "A program is trying to automatically send e-mail on your behalf. Do
>> you want to allow this?"
>> Yes, No or Cancel.
>>
>> Is there a way to either turn off the alert or automatically answer
>> Yes. Relevent part of program:
>> ---------------------------------------------
>> Set appOL = CreateObject("Outlook.Application")
>> Set appMess = appOL.CreateItem(olMailItem)
>>
>> For cnt = 1 To 99
>> If ISLIKE(Cells(cnt, 12).Value, "*@*") Then 'does cell contain
>> email address?
>> appMess.To = "Valid.e-mail@address"
>> appMess.Subject = "tester"
>> appMess.Body = "test"
>> appMess.Send <------ this causes alert to show
>>
>> End If
>> Next cnt
>>
>> appMess.Quit
>> appOL.Quit
>> Set appOL = Nothing
>> Set appMess = Nothing
>>
>> ---------------------------
>>
>> Henry
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum