none
How can I safely add RTF into the mailitems RTFBody? RRS feed

  • Question

  • When a user sends email I (using an addin) need to add text prior to the users entry and then also append text after.  I've looked at several emails Outlook generated and have not found a safe place to add the additional text.  Does anyone know of a safe what to add text both pre & post the email message?

    Thanks

    Wednesday, September 12, 2012 10:24 PM

Answers

  • You could use Inspector.WordEditor on an Inspector for an item, WordEditor is a Word.Document object. You could then use the Word object model to add whatever you want, save as rich text and then put that into your item.
     
    I suppose a question might be why use RTF at all, and not HTML, which is easier to work with and not limited to being received only by Outlook clients, as is RTF email?

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "G Clark" <=?utf-8?B?RyBDbGFyaw==?=> wrote in message news:92c7e61a-b200-4ae0-b28d-6422e1710ffc...

    When a user sends email I (using an addin) need to add text prior to the users entry and then also append text after.  I've looked at several emails Outlook generated and have not found a safe place to add the additional text.  Does anyone know of a safe what to add text both pre & post the email message?

    Thanks


    Ken Slovak MVP - Outlook
    Thursday, September 13, 2012 2:44 PM
    Moderator

All replies

  • You could use Inspector.WordEditor on an Inspector for an item, WordEditor is a Word.Document object. You could then use the Word object model to add whatever you want, save as rich text and then put that into your item.
     
    I suppose a question might be why use RTF at all, and not HTML, which is easier to work with and not limited to being received only by Outlook clients, as is RTF email?

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "G Clark" <=?utf-8?B?RyBDbGFyaw==?=> wrote in message news:92c7e61a-b200-4ae0-b28d-6422e1710ffc...

    When a user sends email I (using an addin) need to add text prior to the users entry and then also append text after.  I've looked at several emails Outlook generated and have not found a safe place to add the additional text.  Does anyone know of a safe what to add text both pre & post the email message?

    Thanks


    Ken Slovak MVP - Outlook
    Thursday, September 13, 2012 2:44 PM
    Moderator
  • Ken,

    Thanks for your response.  I cannot restrict the use of RTF so my addin must work with it.  I am looking for a 'safe' place to add the additional text.  I've been inserting my pre email text just after the first set of '}}' found within the RTFBody and the post text just prior to the last '}' found in the RTFBody.  Testing so far has been successful.  Any other tips or suggestions are greatly appreciated.  Thanks again.

    Gary 

    Sunday, September 16, 2012 3:25 PM
  • Other than using WordMail to do RTF I don't have any tips. I try to avoid RTF where I can :)

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "G Clark" <=?utf-8?B?RyBDbGFyaw==?=> wrote in message news:1e778fc4-7590-40e7-885b-af403893dd1e...

    Ken,

    Thanks for your response.  I cannot restrict the use of RTF so my addin must work with it.  I am looking for a 'safe' place to add the additional text.  I've been inserting my pre email text just after the first set of '}}' found within the RTFBody and the post text just prior to the last '}' found in the RTFBody.  Testing so far has been successful.  Any other tips or suggestions are greatly appreciated.  Thanks again.

    Gary 


    Ken Slovak MVP - Outlook
    Monday, September 17, 2012 6:14 PM
    Moderator
  • To add text at the top of an email body I have been searching for 1st instance of \insrsid and then finding the opening brace "{" for the group that contains that instance of \insrsid.

    I insert new text before that opening brace (I insert a whole group with formatting and text at that point)

    • Edited by pscross Wednesday, July 31, 2013 12:58 PM
    Wednesday, July 31, 2013 12:50 PM