security window

Status
Not open for further replies.
C

Curt

Have the following code. When used to send e-mails. I get a window for each

e-mail saying it is being sent auto and do I want it to do this. How can I

have it send all e-mails auto without asking on each one.

Thanks for assistance

'Send E-Mails

Private Sub OptionButton9_Click()

OptionButton9.Value = False

UserForm4_Letters.Hide

Sheets("Data").Select

Dim OutApp As Object

Dim OutMail As Object

Dim cell As range

Application.ScreenUpdating = False

Set OutApp = CreateObject("Outlook.Application")

OutApp.Session.Logon

On Error GoTo cleanup

For Each cell In

Sheets("Data").Columns("K").Cells.specialcells(xlcelltypeconstants)

If cell.Value Like "?*@?*" Then

Set OutMail = OutApp.CreateItem(0)

On Error Resume Next

With OutMail

> .To = cell.Value

> .subject = "Parade Reminder"

> .Body = "Dear: Partcipant " & cell.Offset(0, -1).Value & vbNewLine &

vbNewLine & _

"The attachment is for FYI."

'You can add files also like this

> .Attachments.Add ("\Parade\E-mail Attachment Letter.doc")

> .Send

'Or use Display

End With

On Error GoTo 0

Set OutMail = Nothing

End If

Next cell

cleanup:

Set OutApp = Nothing

Application.ScreenUpdating = True

End Sub
 
S

Sue Mosher [MVP]

Your options depend on the type of application and Outlook version. See See

http://www.outlookcode.com/article.aspx?ID=52

Sue Mosher

"Curt" <Curt> wrote in message

news:CB8D8805-AB98-4075-891D-561B55C53D21@microsoft.com...
> Have the following code. When used to send e-mails. I get a window for
> each
> e-mail saying it is being sent auto and do I want it to do this. How can I
> have it send all e-mails auto without asking on each one.
> Thanks for assistance

> 'Send E-Mails
> Private Sub OptionButton9_Click()
> OptionButton9.Value = False
> UserForm4_Letters.Hide
> Sheets("Data").Select
> Dim OutApp As Object
> Dim OutMail As Object
> Dim cell As range
> Application.ScreenUpdating = False
> Set OutApp = CreateObject("Outlook.Application")
> OutApp.Session.Logon
> On Error GoTo cleanup
> For Each cell In
> Sheets("Data").Columns("K").Cells.specialcells(xlcelltypeconstants)
> If cell.Value Like "?*@?*" Then
> Set OutMail = OutApp.CreateItem(0)
> On Error Resume Next
> With OutMail
> .To = cell.Value
> .subject = "Parade Reminder"
> .Body = "Dear: Partcipant " & cell.Offset(0, -1).Value & vbNewLine &
> vbNewLine & _
> "The attachment is for FYI."
> 'You can add files also like this
> .Attachments.Add ("\Parade\E-mail Attachment Letter.doc")
> .Send
> 'Or use Display
> End With
> On Error GoTo 0
> Set OutMail = Nothing
> End If
> Next cell
> cleanup:
> Set OutApp = Nothing
> Application.ScreenUpdating = True
> End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
DoctorJellybean Windows Security Credentials appears once a day Using Outlook 2
noshairwan Registry cannot be found, Outlook Security Using Outlook 2
J Is it no longer possible to suppress Outlook 2019 Invalid Certificate name mismatch security alert via Registry? Using Outlook 1
D Security patch seems to kill vbscript on Enterprise Level Outlook VBA and Custom Forms 4
M 3rd Party Certificate now Security Alert Exchange Server Administration 2
Diane Poremsky Outlook Email Security Update Using Outlook 0
J Customize Attachement Security Warning Using Outlook 1
I Microsoft Security Update KB3097877 Using Outlook 14
Diane Poremsky The security certificate is not from a trusted certifying authority Using Outlook 0
smokiibear windows security mail application not accepting username and password Using Outlook 0
B Outlook Anywhere vs Activesync and Enterprise Security Exchange Server Administration 8
Commodore Skype and contacts security/privacy Using Outlook 1
E email security (backups) Using Outlook 2
A "Microsoft Exchange Add-In" (UmOutlookAddin.dll) + Outlook Security Form ... Using Outlook 4
T Outlook 2007 SSL selfsigned certificate how to stop security popup everytime? Using Outlook 10
T Outlook 2013, McAfee Security Suite and SMTP/POP3 Using Outlook 3
D Windows Security Using Outlook 1
D Outlook Security Question Using Outlook 3
C Security Question - How to prevent users exporting .iaf files Using Outlook 5
G Security-enabled Distro Group Members Can't Access Associated Group Mailbox Using Outlook 1
B 2003 >> 2010 outlook today security changes (Iframes? Href?) Using Outlook 1
H Microsoft outlook security notice Using Outlook 2
B Re: The server you are connected to is using a security certificate that could not be verified. The Using Outlook 4
L Need to Override Outlook 2007's security Outlook VBA and Custom Forms 1
R outlook macro security issue Outlook VBA and Custom Forms 3
J Using Group Policy to control Outlook security/attachments behaviour Outlook VBA and Custom Forms 1
R Programmatic Access Security Pop up with Wordeditor Outlook VBA and Custom Forms 6
T How to get MailItem.Body without security warning in Outlook 2010 Outlook VBA and Custom Forms 2
R Application_ItemSend not firing even with low security Outlook VBA and Custom Forms 1
J Outlook 2003 macro security problem Outlook VBA and Custom Forms 6
J Security Restriction Seriously Hampers Outlook Automation Outlook VBA and Custom Forms 1
N Custom Task form - security Outlook VBA and Custom Forms 5
P Outlook security prompt after installing Add-in Outlook VBA and Custom Forms 3
H How turn off outlook security warning dialog box from outlook Outlook VBA and Custom Forms 1
P Stopping that security warning Outlook VBA and Custom Forms 1
S how to disable security message in save attachments macro "A programis trying to access e-mail addre Outlook VBA and Custom Forms 5
S Security exception while opening custom outlook form Outlook VBA and Custom Forms 1
C how to disable outlook security messages Outlook VBA and Custom Forms 1
M EMail viewing security levels BCM (Business Contact Manager) 1
N Item cannot be saved because it was modified by another user or window, and, Item could not be moved... Using Outlook 0
A OutLook For Mac 16.46 Comes Up In Small Window When Opening Using Outlook 4
A How to stop user form from disapearing once mail window is closed? Outlook VBA and Custom Forms 0
J Are the underlined letters in Outlook Reminders window supposed to work? Using Outlook 4
M Where is the setting to *turn off* open calendar in a new window? Using Outlook 3
M Outlook email window maximizes improperly Using Outlook 3
T Change the selected Message in the Outlook window Outlook VBA and Custom Forms 2
P Reminders Window stops being displayed, even with /resetfolders or /cleanreminders Using Outlook 8
D Outlook Message Window Changes Size and Position Using Outlook 1
U Catching ModuleSwitch events after "open in new window" Outlook VBA and Custom Forms 2
e_a_g_l_e_p_i Just had to reinstall window 10 then Office and forgot how to control fonts sizes Using Outlook 3

Similar threads

Top