none
Show/Hide Paragraph Marks programmatically RRS feed

  • Question

  • Hi,

    Does anyone know how to toggle the Show/Hide Paragraph Marks setting in Word programmatically (in C#)?

    Or how to find a hidden paragraph mark when the Paragraph Marks setting is off?

    Thanks in advance!

    Regards,

    Katya


    Katya

    Wednesday, August 29, 2012 7:23 AM

Answers

  • Hi Katya

    To toggle the option to show/hide paragraph marks you need the ShowParagraphs property of the View object (such as document.ActiveWindow.View...). It's Boolean, so set it = true or false. If C# complains, it means the PIA isn't matching it up to Boolean, which mean you'd need to use -1 resp. 0.

    You can always locate hidden paragraph marks using Range.Find.Text = "\r" (ANSI character 13).


    Cindy Meister, VSTO/Word MVP


    Wednesday, August 29, 2012 8:06 AM
    Moderator

All replies

  • Hi Katya

    To toggle the option to show/hide paragraph marks you need the ShowParagraphs property of the View object (such as document.ActiveWindow.View...). It's Boolean, so set it = true or false. If C# complains, it means the PIA isn't matching it up to Boolean, which mean you'd need to use -1 resp. 0.

    You can always locate hidden paragraph marks using Range.Find.Text = "\r" (ANSI character 13).


    Cindy Meister, VSTO/Word MVP


    Wednesday, August 29, 2012 8:06 AM
    Moderator
  • It's "\r".

    Wednesday, August 29, 2012 7:02 PM