kryptonian
Board Regular
- Joined
- Oct 6, 2006
- Messages
- 104
Hi! I need to setup a macro to flag outgoing emails with pdf attachment/s. How do I go about this? Here's what I've been playing with so far...
~~~~~~~~~~~~~
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim atmt As Outlook.Attachment
Dim pdfcount As Integer
Dim intres As Integer
pdfcount = 1
For Each atmt In Outlook.Attachment
If Right(atmt.FileName, 3) = "pdf" Then
pdfcount = pdfcount + 1
End If
Next atmt
intres = MsgBox(pdfcount & " pdf attachments found.", vbYesNo)
If intres = vbNo Then
Cancel = True
End If
End Sub
~~~~~~~~~~~~~
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim atmt As Outlook.Attachment
Dim pdfcount As Integer
Dim intres As Integer
pdfcount = 1
For Each atmt In Outlook.Attachment
If Right(atmt.FileName, 3) = "pdf" Then
pdfcount = pdfcount + 1
End If
Next atmt
intres = MsgBox(pdfcount & " pdf attachments found.", vbYesNo)
If intres = vbNo Then
Cancel = True
End If
End Sub