M
Mike
Hi,
My boss asked me to come up with a way that users would see a prompt when
they send an email (to absolutely confirm they want to send it, to ensure it
has the correct content and is addressed correctly).
After some searching around, I found some code which will do this (which is
shown below).
The code makes the prompt appear for all messages, but thinking about this
some more (and do not annoy everyone), would it be possible to only have the
prompt appear when email someone from outside our organisation?
Doing a clever lookup in VB to check against users in the GAL might be a bit
tricky, so I was thinking a simply list of internal staff in the code(we only
have 60 so it's not a headache to keep this list updated). The code would
check if only internal people were in either the to, cc or bcc fields then it
wouldn't show the prompt. If one person who wasn't on the list appeared (i.e.
it was being sent to someone outside) then the prompt would show.
Is this possible? and if so, how? My VB skills are poor to say the least.
The code is below if anyone care to offer advice on how I can add the list
and have it check upon sending?!?
Many thanks
[CODE STARTS BELOW]
Option Explicit
Dim WithEvents objInspectors As Inspectors
Dim WithEvents objMyNewMail As MailItem
Private Sub Application_Startup()
Set objInspectors = Application.Inspectors
End Sub
Private Sub Application_Quit()
Set objInspectors = Nothing
Set objMyNewMail = Nothing
End Sub
Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Class <> olMail Then Exit Sub
Set objMyNewMail = Inspector.CurrentItem
End Sub
Private Sub objMyNewMail_Send(Cancel As Boolean)
If MsgBox("Are you sure you want to send this message?", vbYesNo +
vbQuestion _
, "Send Confirmation") = vbNo Then
Cancel = True
End If
End Sub
[CODE FINISHES HERE]
My boss asked me to come up with a way that users would see a prompt when
they send an email (to absolutely confirm they want to send it, to ensure it
has the correct content and is addressed correctly).
After some searching around, I found some code which will do this (which is
shown below).
The code makes the prompt appear for all messages, but thinking about this
some more (and do not annoy everyone), would it be possible to only have the
prompt appear when email someone from outside our organisation?
Doing a clever lookup in VB to check against users in the GAL might be a bit
tricky, so I was thinking a simply list of internal staff in the code(we only
have 60 so it's not a headache to keep this list updated). The code would
check if only internal people were in either the to, cc or bcc fields then it
wouldn't show the prompt. If one person who wasn't on the list appeared (i.e.
it was being sent to someone outside) then the prompt would show.
Is this possible? and if so, how? My VB skills are poor to say the least.
The code is below if anyone care to offer advice on how I can add the list
and have it check upon sending?!?
Many thanks
[CODE STARTS BELOW]
Option Explicit
Dim WithEvents objInspectors As Inspectors
Dim WithEvents objMyNewMail As MailItem
Private Sub Application_Startup()
Set objInspectors = Application.Inspectors
End Sub
Private Sub Application_Quit()
Set objInspectors = Nothing
Set objMyNewMail = Nothing
End Sub
Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Class <> olMail Then Exit Sub
Set objMyNewMail = Inspector.CurrentItem
End Sub
Private Sub objMyNewMail_Send(Cancel As Boolean)
If MsgBox("Are you sure you want to send this message?", vbYesNo +
vbQuestion _
, "Send Confirmation") = vbNo Then
Cancel = True
End If
End Sub
[CODE FINISHES HERE]