Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Macro - way to get round security prompt 2

Status
Not open for further replies.

nieironsio

Vendor
Oct 13, 2006
39
GB
Hello there

I have created a macro that sends a message to set addresses when a criterion is met. However on my outlook it brings a security pop up, is there something i can incoporate in my code that automates or gets riund this part as well.

Many thanks

N
 




You ought to be thaqnkful that there is no way. Otherwise EVERYONE with nefarious intent woulod be using such a technique, don't you think???

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
search the FAQs in the VBA forum - therre are at least 3 that deal with this. Bottom line is that do do it, you either need a 3rd party application or you need to code within Outlook (from excel)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
thanks guys

i hadn't considered the darker side to my request. I am trying to create a reminder e-mail within my own coputer.
I am trying to do it from my own computer to send to someone elses if a something on the spreadsheet becomes 'overdue'. Of course it would be potentially abusable.

Thanks for the advise

 
Thanks

unfortunately this is a work PC on their network and they have admin control - therefore no downloads, real pain.

 
nieironsio,
no downloads at all? blat does not need admin privelages to install.
can you go to your network admin and make the case that automating this will save time / money? if so they may let you.
regards,
longhair
 
You should be able to do this with VBA. We don't use outlook, but I've done this with both GroupWise and Lotus Notes.

Do a search as xlbo suggested. If you need help, post a new thread in forum707.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Or you could do what Microsoft suggests (God forbid):
Downloaded and register cdo 1.2.1 to C:\Program Files\Common Files\System\Mapi\1033\cdo.dll;
this is the earlier release without popup security dialogs (newer is cdo 1.2.1s).

Knowledge is knowing a tomato is a fruit; Wisdom is not putting it in a fruit salad.
 
Hello

Apologies, i'm trying several approaches at once and attempting to work. Thanks to all who have posted. I'm currently working on this code

[Private Sub sendmail()

Dim objol As New Outlook.Application
Dim objmail As mailitem

On Error GoTo SendMail_Err

Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)

With objmail
.To = "me@thisisdoingmyheadinnow.com"
'enter in here the email address
.Subject = "Test"
.Body = "nik"
.DeleteAfterSubmit = True
.NoAging = True
' .Attachments.Add PathName
.Display
End With

Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True 'send the email without security checking
Exit Sub

SendMail_Err:
DoEvents

End Sub/]

this for some reason is not working. any ideas?

Thanks
 
what is not working? the send of the mail or the bypassing of the security prompt? do you get any error messages? if so, hit debug and tell us the line that is highlighted

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
xlbo

If i play the code in the VBA screen exactly how it is (other than the e-mail add) i get a 'compile error: user-defined type not defined. highlighting the first dim

Dim objol As New Outlook.Application
 
Check your references (In the VBEditor, Tools > References). Do you have anything with OutLook checked?

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
thank you v much

you have cracked it! thats the prob with my VBA knowledge - very patchy and self taught.

Thanks a million

So in summary to anyone who ever refs this in future i used the below code to send a message and bypass outlook security prompt (NB make sure you have 'Microsoft Outlook 11.0 Object Library' ticked in your references Tools, References in VBA window:

Private Sub sendmail()

Dim objol As New Outlook.Application
Dim objmail As mailitem

On Error GoTo SendMail_Err

Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)

With objmail
.To = "Test@Random.co.uk" 'enter in here the email address
.Subject = "Test"
.Body = "nik"
.DeleteAfterSubmit = True
.NoAging = True
' .Attachments.Add PathName
.Display
End With

Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True 'send the email without security checking
Exit Sub

SendMail_Err:
DoEvents

End Sub

Thanks again to all
 
Hmmm, does not work with Word 2002, with the proper Outlook Reference checked.

I wondering how it can, as you you never use a .Send on the MailItem. Further, although there is a .Display - and a message window is in fact created - it is NOT visible as it is not told to be visible (i.e. active focus).

Maybe Excel 2003 is different.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top