none
Find bottom of message in reply RRS feed

  • Question

  • Is it possible to find the bottom of the current message in an outlook mail item? When users reply to a message it quotes every other reply in the chain, so the bottom of the user's message isn't the same as the bottom of the overall message. and I wish I could explain that in words that make sense...

    Is it possible to find the bottom of the new message, like the signature does? Somehow it knows to put itself under the new message and above the quoted replies rather than at the very bottom of the message. I'd like to insert a legal disclaimer in a similar way. Rather than being at the top of the message it would be above or below the signature and clearly explain that the enclosed naughty pics are the property of the sender and not to be distributed without express written consent, or whatever pointless thing we're doing

     

    public void Outlook_App_ItemSend(object Item, ref bool Cancel)
    {
      Outlook.MailItem Outlook_MailtItem = (Outlook.MailItem)Item;
    
      Outlook.Inspector inspector = Outlook_MailtItem.GetInspector;
      Word.Document document = (Word.Document)inspector.WordEditor;
      Word.Range range = document.Range(0, 0);// top of message
       ...
    
    

     
    Thursday, November 14, 2013 4:19 PM

Answers

  • Hi,

    According to your description, you want to insert a legal disclaimer above or below the signature of the new message rather than the bottom of the overall message when reply to a message.

    To achieve the goal, we should to get the position of the signature and insert the string before or after the signature.

    I’m afraid there is no method to get the position of a signature directly in Office Object Model. Though we could try to find specific String in the document and use the Range.InsertAfter method to insert some Strings, I don't suggest you to do that since the mail item will have duplicate String to influence the result.

    Why don’t you add the legal disclaimer into the default signature directly?

    Please correct me if I have any misunderstanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by George Takei Friday, November 15, 2013 4:20 PM
    Friday, November 15, 2013 12:56 PM
    Moderator

All replies

  • Hi,

    According to your description, you want to insert a legal disclaimer above or below the signature of the new message rather than the bottom of the overall message when reply to a message.

    To achieve the goal, we should to get the position of the signature and insert the string before or after the signature.

    I’m afraid there is no method to get the position of a signature directly in Office Object Model. Though we could try to find specific String in the document and use the Range.InsertAfter method to insert some Strings, I don't suggest you to do that since the mail item will have duplicate String to influence the result.

    Why don’t you add the legal disclaimer into the default signature directly?

    Please correct me if I have any misunderstanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by George Takei Friday, November 15, 2013 4:20 PM
    Friday, November 15, 2013 12:56 PM
    Moderator
  • Thanks for the reply

    What I'd like to do is insert a legal disclaimer below the new message, in the place where the signature goes, but regardless of the signature. There may not always be a signature.

    Aside from the signature's lack of permanence, we unfortunately have different disclaimers for different cases and wouldn't be able to set it up as a single signature + disclaimer. (it's very important that some messages say "don't steal me" while others say "seriously. don't steal me")

    Searching for the signature is a good suggestion but again it's open to the user to exclude or change their signature if they really want so I wouldn't trust it to always find the right location.

    I'll take your reply as meaning there's no reliable way to find the end of the new message and leave our disclaimer at the top, which is perfectly acceptable. Thanks again.

    Friday, November 15, 2013 4:20 PM