none
How to programmatically format the Appointment Item body to make the URLs hyperlinked? RRS feed

  • Question

  • Hi,

    In my VSTO Add-In, if a new Appointment Item is created with some text of my own, I want to make all the URLs in that to be hyperlinked.  How can I do programmatically?

    Thanks in advance.


    Thanks Prasad

    Thursday, March 12, 2015 5:42 PM

Answers

  • Hello Prasad,

    You can use the RTFBody property which returns / sets a byte array that represents the body of the Microsoft Outlook item in Rich Text Format. See What is the RTF syntax for a hyperlink? .

    Also you may consider using the WordEditor property of the Inspector class to get an instance of the Word Document which represents the message body. The Document class provides the Hyperlinks property which returns a Hyperlinks collection that represents all the hyperlinks in the specified document. You can use the Add method to add a new hyperlink to the Document (body of the Outlook item).

    • Marked as answer by Prasad U S Friday, March 13, 2015 12:33 PM
    Thursday, March 12, 2015 6:03 PM

All replies

  • Hello Prasad,

    You can use the RTFBody property which returns / sets a byte array that represents the body of the Microsoft Outlook item in Rich Text Format. See What is the RTF syntax for a hyperlink? .

    Also you may consider using the WordEditor property of the Inspector class to get an instance of the Word Document which represents the message body. The Document class provides the Hyperlinks property which returns a Hyperlinks collection that represents all the hyperlinks in the specified document. You can use the Add method to add a new hyperlink to the Document (body of the Outlook item).

    • Marked as answer by Prasad U S Friday, March 13, 2015 12:33 PM
    Thursday, March 12, 2015 6:03 PM
  • Hi Eugene,

    Thanks for your reply.

    Also, is there a way to use AutoFormat for the Word Document which represents the message body?

    Thanks in advance.


    Thanks Prasad

    Friday, March 13, 2015 11:46 AM
  • Prasad,

    I'd suggest asking separate questions in new forum threads. Thus, forum readers may recognize questions and answers easily.

    The Word for Developers  forum is the right place for Word-specific questions. VSTO doesn't provide anything for that.

    Friday, March 13, 2015 12:20 PM
  • Thanks for the reply Eugene. As the autoformat can make the URLs hyperlinked, I asked that question.

    Thanks again for the help.


    Thanks Prasad

    Friday, March 13, 2015 12:33 PM