Checking Recipient Group before sending email via VBA

G

Gurvinder

Is there any way to check via VBA if the recipient is a specific group
or keywords before sending any email to bring up a pop-up saying "Are
you sure you want to send this message to a group"

Saving you lapse in picking the wrong group to send emails to.

Outlook 2007 - Exchange 2003.

Thanks in advance.
 
K

Ken Slovak

What sort of group? Do you mean an Outlook distribution list, or one in an
Exchange GAL, or ...?

It would also depend on whether or not a distribution list, if that's what
you are talking about, is expanded or not.

What about keywords? Do you mean categories, or what? Please explain.
 
J

Jay Brigand

Hi,

I'm actually looking to set up something similar.

Ideally, I want to get something set up so that if I write an email and address it to the Distribution Group "All Users" it will come up with a pop up asking me to confirm if I want to send it with a yes or no button.

Ideally, it would be something similar to the below code but for checking if it is being sent to the distribution list instead of having an attachment:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'
If InStr(1, Item.Body, "attach", vbTextCompare) > 0 Then
If Item.Attachments.Count = 0 Then
ans = MsgBox("There's no attachment, send anyway?", vbYesNo)
If ans = vbNo Then Cancel = True
End If
End If
End Sub

Any help would be greately appreciated.
- J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top