none
VBA code to convert a Forward to a Reply RRS feed

  • Question

  • Hello,

    I am wondering if there is a simple VBA code to cionvert a "forward" into a "reply", so basically the only thing the code will do is fill in the "to" with the email of original sender, and change the "FW" to "RE" in the subject line. The reason I need this, is because I want to include the original attachments in the email. Thanks in advance

    Tuesday, July 16, 2013 1:38 PM

Answers

  • PR_LAST_VERB_EXECUTED and other MAPI properties on the parent item won't be set properly using that method, and some MAPI properties on the reply//forward item won't be set correctly either.

    Why not get ActiveExplorer().Selection[1] and call the Reply method on the parent? The save out the attachments to the file system and load them as attachments on the new Reply item.


    Ken Slovak MVP - Outlook

    • Marked as answer by PC_Meister Thursday, July 18, 2013 5:42 PM
    Tuesday, July 16, 2013 3:18 PM
    Moderator

All replies

  • You could do this manually, assuming your code is running under the context of the compose message, by:

    • Using ActiveExplorer.Selection(1) to get the email you are forwarding (store the MailItem object in a variable)
    • Use ActiveInspector.CurrentItem to set the properties of the message: replace instances of "FW:" in the subject line with "RE:", and grab MailItem.SenderEmailAddress from the original and pass that to the MailItem.Recipients.Add collection or the MailItem.To property

    Eric Legault (MVP: Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Tuesday, July 16, 2013 2:59 PM
    Moderator
  • PR_LAST_VERB_EXECUTED and other MAPI properties on the parent item won't be set properly using that method, and some MAPI properties on the reply//forward item won't be set correctly either.

    Why not get ActiveExplorer().Selection[1] and call the Reply method on the parent? The save out the attachments to the file system and load them as attachments on the new Reply item.


    Ken Slovak MVP - Outlook

    • Marked as answer by PC_Meister Thursday, July 18, 2013 5:42 PM
    Tuesday, July 16, 2013 3:18 PM
    Moderator