When I write an email (with attachments) and send it to someone it would be very helpful to have Outlook automatically include a list of the attachments (filenames) at the beginning of my email text body before finally sending it out.This way the recipient cannot accidently miss/overlook the attachment when I do not specifically mention it in the email. When the recipient replies with my original message included I can quickly check what attachments I included with my first email without looking it up in the "sent mail". When including a bunch of attachments (let's say 10 jpg pictures) the recipient overlooks the last attachments and is not aware of them since there is no complete list in the text body.
It's actually fairly easy to convert the Reply macro to work with an ItemSend macro to do this as the message is sent, or you could run the macro manually before sending.
As the message is sent, the ItemSend macro checks for attachmwents and if one or more are found, it calls the AddAttachmentNames macro that adds the filenames to the message body. If you include images in your signature, you can skip smaller attachments by uncommenting the lines that check the file size.
To test the macro, send a message that has attachments.
This macro goes in ThisOutlookSession
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If Item.Attachments.Count > 0 Then AddAttachmentNames Item End If End Sub
This macro goes in a Module. Right click on ThisOutlookSAession and choose Insert, Module to add a new module.
Public Sub AddAttachmentNames(oItem As MailItem) Dim oAtt As Attachment Dim strAtt As String Dim olInspector As Outlook.Inspector Dim olDocument As Word.Document Dim olSelection As Word.Selection strAtt = "" For Each oAtt In oItem.Attachments ' If oAtt.Size > 5200 Then strAtt = strAtt & " <<" & oAtt.FileName & ">> " ' End If Next oAtt Set olInspector = Application.ActiveInspector() Set olDocument = olInspector.WordEditor Set olSelection = olDocument.Application.Selection olSelection.HomeKey Unit:=wdStory olSelection.InsertBefore "See attachments: " &strAtt & vbCrLf & vbCrLf Set oItem = Nothing End Sub
If you want to run the macro manually on specific messages, replace the sub name with the following two lines.
Public Sub AddAttachmentNames()
Dim oItem As MailItem
Then add these lines before strAtt = ""
Set oItem = Application.ActiveInspector.CurrentItem
If oItem.Attachments.Count = 0 Then
To make it easier to run the macro, add a macro button to the compose mail form window.