VBA Code for Word Navigation Pane failed view-showheading-method-word
Posted zxyblog
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VBA Code for Word Navigation Pane failed view-showheading-method-word相关的知识,希望对你有一定的参考价值。
https://msdn.microsoft.com/VBA/Word-VBA/articles/view-showheading-method-word
View.ShowHeading Method (Word)
Shows all headings up to the specified heading level and hides subordinate headings and body text.
Syntax
expression . ShowHeading( Level )
expression Required. A variable that represents a View object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Level | Required | Long | The outline heading level (a number from 1 to 9). |
Remarks
This method generates an error if the view isn‘t outline view or master document view.
Example
This example switches the active window to outline view and displays all text that‘s formatted with the Heading 1 style. Body text and all other types of headings are hidden.
With ActiveDocument.ActiveWindow.View
.Type = wdOutlineView
.ShowHeading 1
End With
This example switches the window for Document1 to outline view and displays all text that‘s formatted with the Heading 1, Heading 2, or Heading 3 style.
With Windows("Document1").View
.Type = wdOutlineView
.ShowHeading 3
End With
See also
Concepts
以上是关于VBA Code for Word Navigation Pane failed view-showheading-method-word的主要内容,如果未能解决你的问题,请参考以下文章
高分跪求 VBA word中实现循环搜索 并在WORD中找到列表 再根据已有数据自动填写进本行其它列
VBA for Access 中的 Code 128 条码无法正常工作