none
Prefixing not working when calling mailitem.Reply from plugin (VSTO) RRS feed

  • Question

  • When user presses button reply in Outlook (2007 to 2013), an prefix (Username) is inserted in changed lines of the copied orginal mail Content.

    When calling the program function MailItem.Reply, prefixing is not working.

    Is any way to activate prefixing in inspector object or word Content?

    Saturday, February 8, 2014 9:48 PM

Answers

  • > When reply with user Interface [xxx] will be inserted on commented lines during editing

    The "editing" is the keyword. The Reply method just creates a reply, pre-addressed to the original sender, from the original message. It doesn't edit your e-mail in any way. Instead, you should append your further body customizations with the preface word[s] programmatically.


    • Edited by Eugene Astafiev Monday, February 10, 2014 7:11 AM typos
    • Marked as answer by Marvin_Guo Monday, February 17, 2014 4:19 PM
    Sunday, February 9, 2014 7:46 PM

All replies

  • Hello SEP CH,

    I have just tested the following VBA macro in Outlook 2013:

    Public Sub replytest()
     Dim selection As Outlook.selection
     Dim mail As Outlook.MailItem
     Dim reply As Outlook.MailItem
     Set selection = ActiveExplorer.selection
     Set mail = selection.Item(1) 
     Set reply = mail.reply()
     reply.Display
    End Sub

    Also I have tested the identical code in the Outlook add-in:

    Outlook.Explorer explorer = OutlookApp.ActiveExplorer();
    Outlook.Selection selection = explorer.Selection;
    Outlook.MailItem mail = selection[1] as Outlook.MailItem;
    Outlook.MailItem reply = mail.Reply();
    reply.Display();

    I always get the same results. The source message (in plain text) is appended by the credentials I set in Outlook settings dialog. It doesn't matter whether you call the Reply method programmatically or reply to the message manually. Instead, it depends on the source message format you are replying to:

    As you may see on the screenshot, only plain-text messages can be prefaced with a text specified in the Outlook settings. In case of other formats only comments are prefaced (not each line of text).


    Sunday, February 9, 2014 8:23 AM
  • Thanks for the Response.

    The function I am looking for is 'Preface comments with: xxx' for HTML mails.

    When reply with user Interface [xxx] will be inserted on commented lines during editing, but not if reply is called through code mail.Reply()

    Sunday, February 9, 2014 6:32 PM
  • > When reply with user Interface [xxx] will be inserted on commented lines during editing

    The "editing" is the keyword. The Reply method just creates a reply, pre-addressed to the original sender, from the original message. It doesn't edit your e-mail in any way. Instead, you should append your further body customizations with the preface word[s] programmatically.


    • Edited by Eugene Astafiev Monday, February 10, 2014 7:11 AM typos
    • Marked as answer by Marvin_Guo Monday, February 17, 2014 4:19 PM
    Sunday, February 9, 2014 7:46 PM