Creating a visual hierarchy from ContentControls RRS feed

  • Question

  • Hello,

    I am using VSTO 3.0 + Visual Studio 2008 C# and developing an Add-In for Microsoft Office 2007.I want to create a visual hierarchy (present only in the document with  indent) in the Document from different ContentControls.


    Is there a way to add indent before an Interop.Word.ContentControl BuildingBlockGallery that spreads on multiple lines?Or another way to generate in the document a hierarchy (like that of a list) from multiple BuildingBlockGallery found in the document?


    I know it works for ContentControls that not exceed one line. I am interested only for ContentControls that exceed that limit.

    Don`t know if it is relevant, but the BuildingBlockGallery`s contain other contentcontrols.


    Best regards,

    Friday, April 8, 2011 9:33 AM


  • Hi Silviu

    I'm not completely clear on what you mean by "hierarchy". The first visual picture I get is something like an organigramm, but after thinking about this for a while I wonder if you mean "Outline"? Each level is indented?

    I don't think there's going to be any way to insert a building block of multiple content controls and have them dynamically assume outline levels (for instance, if you start at level 2, something indented one level in the building block would assume level 3). Word doesn't work that way. All outline levels are absolute, and they're best applied using Style definitions.

    If you were to save a Building Block with a single content control without any formatting and set to not include a paragraph mark, then inserting it into a formatted paragraph should apply that paragraph formatting to the Building Block content.

    Cindy Meister, VSTO/Word MVP
    Friday, April 8, 2011 10:19 AM