none
Word Content Control options to add padding/margin to outside of control RRS feed

  • Question

  • We are using ContentControls in a Word VSTO application for a customer.  However, the lines drawn around the content control are slightly overlapping adjacent content.  Can we change the padding/margins around the content control?

    I haven't found any options for this, so my other question is, can a developer write their own content control to use in Word?

    Thanks


    -herb
    Wednesday, October 5, 2011 5:40 PM

Answers

  • Hi Herb

    <<Can we change the padding/margins around the content control?>>

    There's no provision for this, although depending on exactly how the content controls are used, putting them in separate table cells could give you the required effect...

    You're going to see this with adjacent content controls since the one thing Word will not do is compromise the text flow of the document (creating extra space, for example). The content controls are not part of the text flow - they simple delineate structured areas during the editing of the document - so if they're adjacent then their "frames" are going to overlap. But normally you wouldn't see that, as a content control would only be visible when the mouse is over it or it has the focus.

    <<can a developer write their own content control to use in Word?>>

    No.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by HerbF Friday, October 14, 2011 12:04 AM
    Wednesday, October 5, 2011 9:28 PM
    Moderator

All replies

  • Hi Herb

    <<Can we change the padding/margins around the content control?>>

    There's no provision for this, although depending on exactly how the content controls are used, putting them in separate table cells could give you the required effect...

    You're going to see this with adjacent content controls since the one thing Word will not do is compromise the text flow of the document (creating extra space, for example). The content controls are not part of the text flow - they simple delineate structured areas during the editing of the document - so if they're adjacent then their "frames" are going to overlap. But normally you wouldn't see that, as a content control would only be visible when the mouse is over it or it has the focus.

    <<can a developer write their own content control to use in Word?>>

    No.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by HerbF Friday, October 14, 2011 12:04 AM
    Wednesday, October 5, 2011 9:28 PM
    Moderator
  • Hi Herb,

    How about the problem on your side? Have you figured out the problem? If you still show any concern on the thread, just feel free to let us know.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Bruce Song Monday, October 10, 2011 1:35 AM
    Monday, October 10, 2011 1:35 AM
  • I was hoping to be able to either configure the content control's borders or to write my own that had a customizable border.  However, for the purposes we're working with, I can remove the text in the content border tab and then the tab appears on the left of the content control rather than the top.  This helps, though not a complete solution, we can live with it.

    It would help if we could inherit from the content control class and extend it.

    Thanks for the responses.


    -herb
    Friday, October 14, 2011 12:06 AM
  • Just a note to add, Office 2013 adds different visualization styles for Content Controls so with Word 2013 you can specify that a content control not be shown with borders.  The default behavior is with borders like Word 2007/2010 but there are other options in 2013.  See http://msdn.microsoft.com/en-us/library/office/jj889465.aspx for details.

    -herb

    Wednesday, July 24, 2013 3:11 PM