none
Reply message with attachment listing in text RRS feed

  • Question

  • Good Day~

    I want my Outlook reply/reply all messages to list any attachments as:

    From: jdoe@internet.com

    Sent: Friday, 06 November, 2015 12:29

    To: doej@internet.com

    Cc: jjdoe@internet.com

    Subject: 2016 Leader Nomination Solicitation

    Attachments: CMCLC Participant Guidance (Feb 15).docx; NLP Program Information.docx; NLP

    Selection Criteria.docx; NLP_2016-1_Application.docx; SF182 (NLP-2016-1) 1.pdf

    Outlook use to do this in 1997 and 2000.  I can use vba codes.

    Thanks so much in advance~mjc


    mjc


    • Edited by MJFan23 Thursday, November 19, 2015 6:32 PM
    Thursday, November 19, 2015 6:31 PM

Answers

  • >>>but it just puts the names in the area of my reply and not in the reply message header.

    Accordind to your description, I suggest that you could change reply message after you have got attachments information, you could refer to steps:
    1.In Outlook open your Visual Basic Editor
    2.Open Microsoft Office Outlook Objects → ThisOutlookSession
    3.Enter the following Code:

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
       Dim currentItem As MailItem
       Dim message As String
       Set currentItem = Item
       'check Item object is a MailItem to be reply
       If Left(currentItem.Subject, 3) = "RE:" Then
          message = currentItem.Body
          'your logic code to change reply MailItem body with attachments information
          currentItem.Body = Replace(message, "Subject:", "Subject: Attachments:1.docx")
       End If
    End Sub

    • Marked as answer by David_JunFeng Wednesday, December 2, 2015 8:57 AM
    Wednesday, November 25, 2015 8:07 AM

All replies

  • Hello,

    You can use the Attachements property of the MailItem class to access all attached items. The property returns an Attachments object that represents all the attachments for the specified item. 

    The Chapter 17: Working with Item Bodies article describes all possible ways for working with item bodies. You just need to gather the attachments info and paste it to the message body.

    Note, you can edit any outgoing email by handling the ItemSend event of the Application class. It is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item, such as MailItem, is used in a program.

    Finally, you may find the Getting Started with VBA in Outlook 2010 article helpful.

    Thursday, November 19, 2015 7:09 PM
  • Good Day Mr. Astafiev~

    Thank you so much for your reply .  Right now when I click Reply Or Reply All to a message that has one or more attachments, my reply is displayed like this:

    From: jdoe@internet.com

    Sent: Friday, 06 November, 2015 12:29

    To: doej@internet.com

    Cc: jjdoe@internet.com

    Subject: 2016 Leader Nomination Solicitation

    I would like the reply to display just like this:

    From: jdoe@internet.com

    Sent: Friday, 06 November, 2015 12:29

    To: doej@internet.com

    Cc: jjdoe@internet.com

    Subject: 2016 Leader Nomination Solicitation

    Attachments: CMCLC Participant Guidance (Feb 15).docx; NLP Program Information.docx; NLP

    Selection Criteria.docx; NLP_2016-1_Application.docx; SF182 (NLP-2016-1) 1.pdf

    Microsoft Outlook 1997 and 2000 would do it but I have 2013 and I cannot find a box to check or anything that I can set for it to do this; so I am trying to do it with vba.

    I have tried this: http://www.slipstick.com/developer/code-samples/insert-attachment-names-replying/, but it just puts the names in the area of my reply and not in the reply message header.

    Thanks again~mjc


    mjc

    Friday, November 20, 2015 2:05 PM
  • >>>but it just puts the names in the area of my reply and not in the reply message header.

    Accordind to your description, I suggest that you could change reply message after you have got attachments information, you could refer to steps:
    1.In Outlook open your Visual Basic Editor
    2.Open Microsoft Office Outlook Objects → ThisOutlookSession
    3.Enter the following Code:

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
       Dim currentItem As MailItem
       Dim message As String
       Set currentItem = Item
       'check Item object is a MailItem to be reply
       If Left(currentItem.Subject, 3) = "RE:" Then
          message = currentItem.Body
          'your logic code to change reply MailItem body with attachments information
          currentItem.Body = Replace(message, "Subject:", "Subject: Attachments:1.docx")
       End If
    End Sub

    • Marked as answer by David_JunFeng Wednesday, December 2, 2015 8:57 AM
    Wednesday, November 25, 2015 8:07 AM
  • Good Day Mr. JunFeng~

    I am trying to use your code and am having no success.

    Any advice?

    Thank you in advance~mjc


    mjc

    Monday, May 16, 2016 1:56 PM
  • Did you try to debug the code?

    You may find the Getting Started with VBA in Outlook 2010 article helpful.


    [custom.development]

    Monday, May 16, 2016 5:23 PM
  • I did not, also I am working with 2013 Outlook.

    I had this working before I upgraded to 2013.


    mjc

    Monday, May 16, 2016 5:59 PM
  • Are macros enabled in Outlook? Did you try to run any?

    Make sure the ItemSend event handler is set properly in VBA environment. Choose the Application class and then the ItemSend in combo boxes at the top of the editor.


    [custom.development]

    Monday, May 16, 2016 7:14 PM
  • Hi MJFan23,

    Have you got any error? Have you successed this macro on an other machine? I suggest that you could provide error or screenshot, that will help us reproduce and resolve it.

    Thanks for your understanding.
    Thursday, August 18, 2016 9:21 AM