none
A BUG that has not been solved for ten years! ActiveWindow.View.ShowParagraphs is no effect! RRS feed

  • Question

  • It is impossible to control the display of "paragraph marks" with the following code. Neither "=True" nor "=False" can do that.

    ActiveWindow.View.ShowParagraphs = True

    This problem has been in existence for more than 10 years!

    Word 2007/2010/2013/2016 all have this problem!

    Sorry! My English is poor!

    ==================================================================

    In Chinese:

    在Word“文件→选项→显示”中,有一个选项是“段落标记”,可以控制是否显示段落标记。

    但是用vba语句“ActiveWindow.View.ShowParagraphs = True”或“ActiveWindow.View.ShowParagraphs = False”无法控制这个开关。

        With ActiveWindow.View
            .ShowTabs = False                             '制表符
            .ShowSpaces = False                         '空格
            .ShowParagraphs = True                   '段落标记
            .ShowHiddenText = False                  '隐藏文字
            .ShowHyphens = False                      '可选连字符
            .ShowObjectAnchors = True              '对象位置
            .ShowOptionalBreaks = False            '可选分隔符
            .ShowAll = False                                '显示所有格式标记
        End With

    上面这段代码,本是用于依次控制“显示”选项中的“制表符、空格、段落标记、隐藏文字、可选连字符、对象位置、可选分隔符、显示所有格式标记”等选项。

    但唯独.ShowParagraphs = True无效,其余几句代码都能正常控制对应选项的开启与关闭。


    我在网上也有看到其他人有反馈过这个问题,我也在多台电脑中用不同版本的Word进行了测试。

    这应该是一个存在了很久的BUG,Word2007/2010/2013/2016都不行。

    我把Office更新到目前最新的v16.0.11425.20228(Monthly更新通道)进行测试,还是没修复。

    希望官方能尽早修复这个BUG!!!

    我使用的Office版本是:v16.0.11425.20228 简体中文 64位

    ==================================================================

    网上反馈这个问题的链接:(早在2009年,也就是10年前,就有人反馈这个问题了,官方就是不修复?)

    doc.ActiveWindow.View.ShowParagraphs is no effect.
    https://social.msdn.microsoft.com/Forums/en-US/99f7eca0-0e61-41ac-8182-ee544de615ba/docactivewindowviewshowparagraphs-is-no-effect

    hides paragraph marks in the active window in office2010 with VBA
    https://answers.microsoft.com/en-us/office/forum/office_2010-word/hides-paragraph-marks-in-the-active-window-in/0b63260a-b56b-e011-8dfc-68b599b31bf5

    word 2007中使用宏设置/取消段落标记无效
    https://answers.microsoft.com/zh-hans/msoffice/forum/msoffice_word-mso_other/word/40b8e717-6529-46b0-bfa8-e6596fb26b69

    Toggling does not work at all at VST/VBA (Hide/Show Enter marking).
    https://social.msdn.microsoft.com/Forums/en-US/19aaff1e-29be-4081-97be-2be94eae8719/toggling-does-not-work-at-all-at-vstvba-hideshow-enter-marking

    Word 2013/2016 can't use vba to control the display of "paragraph marks"
    https://word.uservoice.com/forums/304924-word-for-windows-desktop-application/suggestions/35788870-word-2013-2016-can-t-use-vba-to-control-the-displa

    word2010隐藏段落标记
    http://club.excelhome.net/thread-1143565-1-1.html

    无法使用VBA去掉段落标记
    http://club.excelhome.net/thread-1345304-1-1.html

    用VBA无法控制“段落标记”的显示?这是Word的Bug吗?
    http://club.excelhome.net/thread-1436750-1-1.html

    word2007如何用VBA实现去掉段落标记
    http://club.excelhome.net/forum.php?mod=redirect&goto=findpost&ptid=593873&pid=5400308


    Tuesday, April 23, 2019 11:12 AM

All replies

  • Have you tried to never use ShowAll in new documents, since it overrides ShowParagraphs?

    If ShowParagraphs=False does not work in certain cases, then try this:

    With ActiveWindow.View
        Dim t, s, ht, h, oa, ob
        t = .ShowTabs
        s = .ShowSpaces
        ht = .ShowHiddenText
        h = .ShowHyphens
        oa = .ShowObjectAnchors
        ob = .ShowOptionalBreaks
        .ShowAll = False
        .ShowTabs = t
        .ShowSpaces = s
        .ShowHiddenText = ht
        .ShowHyphens = h
        .ShowObjectAnchors = oa
        .ShowOptionalBreaks = ob
        .ShowParagraphs = False
    End With
    
    

    Tuesday, April 23, 2019 5:14 PM
  • I'm sure I have turned off the ShowAll Before I set the ShowParagraphs.

    I have tried your code, it is still no effect!

    This is my screen recording gif:


    Wednesday, April 24, 2019 12:56 PM
  • Whether this is peculiar to the Chinese interface I cannot say, but in all versions of Word back to 2003 with English interface it works here, with the following macro toggling the setting:

    Sub Macro1()
    ActiveWindow.View.ShowParagraphs = Not ActiveWindow.View.ShowParagraphs
    End Sub




    Graham Mayor - Word MVP
    www.gmayor.com


    Thursday, April 25, 2019 5:16 AM
  • ActiveWindow.View.ShowParagraphs = Not ActiveWindow.View.ShowParagraphs

    This code is still no effect!

    I have tried the following macro

    Sub Macro1()
        ActiveWindow.View.ShowTabs = Not ActiveWindow.View.ShowTabs
        ActiveWindow.View.ShowParagraphs = Not ActiveWindow.View.ShowParagraphs
    End Sub

    ShowTabs works fine!

    ShowParagraphs is no effect!




    • Edited by 孤独无名氏 Saturday, April 27, 2019 2:04 AM add screen recording gif
    Thursday, April 25, 2019 9:21 AM
  • Whether this is peculiar to the Chinese interface I cannot say, but in all versions of Word back to 2003 with English interface it works here, with the following macro toggling the setting:

    Sub Macro1()
    ActiveWindow.View.ShowParagraphs = Not ActiveWindow.View.ShowParagraphs
    End Sub


    I change the Word language to English, the code works fine!!!

    It seems to be peculiar to the Chinese interface!

    Simplified Chinese and Traditional Chinese both not work!



    Thursday, April 25, 2019 9:54 AM
  • Anyone can handle this problem?
    Monday, April 29, 2019 8:42 AM