Professional Documents
Culture Documents
UNameWindows = Environ("USERNAME")
End Function
oMail As Outlook.MailItem
sSubject As String
StrName As Variant
a As String
z As Variant
m As Variant
Clientlist(0 To 8) As String
foundclient As String
foundclient = False
Clientlist(0) = "gettyimages.com"
On Error GoTo Lastline
Set oMail = Application.ActiveInspector.CurrentItem
Set Mail_Object = CreateObject("Outlook.Application")
emailcount = emailcount + 1
m = m & " " & z
Next
For i = LBound(Clientlist) To UBound(Clientlist)
If InStr(1, m, Clientlist(i)) > 1 Then
foundclient = True
Prompt$ = "Mail is being sent to the Client. Do you still want to send the mail?
"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground,
"Do you still want to send the mail?") = vbNo Then
Cancel = True
End If
End If
Next
'a = oMail.Recipients
'
End If
sSubject = oMail.Subject
Dim strSubject As String
Dim lngres As Long
strSubject = Item.Subject
strSubject1 = oMail.Recipients.names
'
oMail.BodyFormat = olFormatHTML
'MsgBox InStr(1, UCase(Item.Body), ".JPG")
If Trim(strSubject) = "" Then
Prompt$ = "Subject line is blank. Are you sure you want to send the
Mail?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground,
"Check for Subject line") = vbNo Then
Cancel = True
End If
End If
If InStr(1, UCase(Item.Body), ".PNG") <> 0 Or InStr(1, UCase(Item.Body),
".JPG") <> 0 Or InStr(1, UCase(Item.Body), ".BMP") <> 0 Then
If Item.Attachments.Count = 1 Then
lngres = MsgBox("'Attach' in body, but no attachment - send anyway?"
, _
vbYesNo + vbDefaultButton2 + vbQuestion, "You asked me to warn you..
.")
If lngres = vbNo Then Cancel = True
End If
End If
If Item.Attachments.Count = 0 And InStr(1, UCase(Item.Body), "ATTACH") <
> 0 Then
lngres = MsgBox("'Attach' in body, but no attachment - send anyway?"
, _
vbYesNo + vbDefaultButton2 + vbQuestion, "You asked me to warn you..
.")
If lngres = vbNo Then
Cancel = True
End If
End If
If Item.Attachments.Count = 0 And InStr(1, UCase(Item.Body), "PFA") <> 0 Then
lngres = MsgBox("'Attach' in body, but no attachment - send anyway?"
, _
vbYesNo + vbDefaultButton2 + vbQuestion, "You asked me to warn you..
.")
If lngres = vbNo Then
Cancel = True
End If
End If
Lastline:
End Sub