none
Can I insert any content in a rich-text box content control?

    Question

  • Hi,

    I'm using Office Professional Plus 2007 and Office Professional 2007. I'd like to know if it's safe to do these operations in a rich text box content control:

    • Insert a several-pages table
    • Insert a somewhat complex and large content, which includes headings, text and tables
    • In general, insert any kind of content in the control

    I've made some experiments adding both manually and with VBA this kind of content to a content control and thus far, the document looks as if I weren't using content controls. I've added headings and tables. The document map, table of contents, print preview, etc. look OK. Just wanted to know if I'm incurring in risks I'm not aware of.

    I'm accessing the control through the Word.Range property.

    Kind regards,

    Carlos Mallen

    Friday, September 20, 2013 12:17 AM

Answers

  • Hi Carlos

    As far as I know, there shouldn't be any problem with what you propose. At least, I've never heard of a RichText content control "going bad" due to what it contains...

    RichText content controls were specifically developed to allow structuring documents, meaning they should be able to contain anything, including other content controls with rich content.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Carlos Mallen Monday, September 30, 2013 9:42 PM
    Monday, September 30, 2013 6:02 PM
    Moderator

All replies

  • Hi,

    I do not suggest you to do that since in the definition of the RichTextBox doesn’t say it supports the table scenarios.

    More detail information please refer to the link: RichTextBox Overview.

    Thursday, September 26, 2013 11:54 AM
  • Hi chunchencool,

    Was it a mistake or the link you provided is for Silverlight? In Word a table is composed of paragraphs. For example, if you loop through the paragraphs collection, you also loop through each cell of a table.

    Cheers,

    Carlos Mallen

    Thursday, September 26, 2013 6:13 PM
  • Hi chunchencool,

    Here's the link for the rich text content control:

    RichTextContentControl Interface

    http://msdn.microsoft.com/en-us/library/vstudio/microsoft.office.tools.word.richtextcontentcontrol(v=vs.100).aspx

    The Remarks section says:

    A RichTextContentControl can contain text as well as many other types of content, including tables, pictures, or other content controls. You can apply a combination of formatting and styles to text in a RichTextContentControl.

    Kind regards,

    Carlos Mallen

    Thursday, September 26, 2013 6:16 PM
  • Hi Carlos,

    Sorry for giving a wrong reference for you, I think you have find the evidence to achieve your goal.

    Thanks for the link you shared.

    Monday, September 30, 2013 1:12 AM
  • Hi Carlos

    As far as I know, there shouldn't be any problem with what you propose. At least, I've never heard of a RichText content control "going bad" due to what it contains...

    RichText content controls were specifically developed to allow structuring documents, meaning they should be able to contain anything, including other content controls with rich content.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Carlos Mallen Monday, September 30, 2013 9:42 PM
    Monday, September 30, 2013 6:02 PM
    Moderator