码迷,mamicode.com
首页 > 编程语言 > 详细

VBA Code for Word Navigation Pane 【failed】 view-showheading-method-word

时间:2017-09-05 01:40:15      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:optional   err   ons   switch   get   variable   ati   UI   ane   

https://msdn.microsoft.com/VBA/Word-VBA/articles/view-showheading-method-word

View.ShowHeading Method (Word)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

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

NameRequired/OptionalData TypeDescription
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

View Object

VBA Code for Word Navigation Pane 【failed】 view-showheading-method-word

标签:optional   err   ons   switch   get   variable   ati   UI   ane   

原文地址:http://www.cnblogs.com/itzxy/p/7476519.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!