none
Follow Up question for Hiding Content Control RRS feed

  • Question

  • I have a template with a company logo embedded in a Content Control in the Header section.

    During printing if the letterhead has a logo already printed, I want to hide the content control while printing.

    This is a FOLLOW UP from my previous post:

    I was able to Hide the content control with the Following code suggested by Cindy.

    cc.Range.Font.Hidden = true; //possibly -1 instead of true

    BUT when the Content Control with the embedded LOGO is hidden, the TEXT below moves UP causing it to print over the LOGO on the letterhead. Is there a way we can avoid this behavior.
    Wednesday, October 24, 2012 12:44 PM

Answers

  • Hi Cindy,

    My bad, I did not observe the Logo was embedded within a Table. When trying your options, I observed the Table, since the borders were hidden, I could not observe that.

    I set the Row properties to be fixed "Exactly" and solves my problem.

    Thanks for your help.

    • Marked as answer by Odsouza Friday, October 26, 2012 3:02 PM
    Friday, October 26, 2012 3:02 PM

All replies

  • Hi Odsouza

    It sounds as if the paragraph mark that probably follows the content control directly, has also been formatted as hidden.

    Turn on the display of non-printing characters (the "backwards P" in the Home tab of the Ribbon). You should now see "backwards P" characters where Enter has been pressed, dots where the space bar has been pressed, etc. Where text has been formatted as hidden, you should see dots under the text, yes? And those extend to the paragraph mark?

    Word sometimes handles spaces oddly when they come at the end of a paragraph, but try - when there's no hidden formatting applied - to add some spaces between the content control and the paragraph mark.

    Now try your code: is the paragraph mark still formatted as hidden, or do the spaces insulate it enough?


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 25, 2012 9:22 PM
    Moderator
  • Hi Cindy,

    My bad, I did not observe the Logo was embedded within a Table. When trying your options, I observed the Table, since the borders were hidden, I could not observe that.

    I set the Row properties to be fixed "Exactly" and solves my problem.

    Thanks for your help.

    • Marked as answer by Odsouza Friday, October 26, 2012 3:02 PM
    Friday, October 26, 2012 3:02 PM