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)

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

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

View Object

时间: 2024-08-08 00:59:13

VBA Code for Word Navigation Pane 【failed】 view-showheading-method-word的相关文章

【LeetCode】- Length of Last Word(最后一个单词的长度)

[ 问题: ] Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. 给你一个字符串,设法获取它最后一个单词的长度.如果这个单词不存在,则返回0. [ 分析 : ] A word is defined

【Leetcode】Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is defined as a character sequence consists of non-space cha

java生成word文档【二】

/** * <p>expWordByItext方法主要用于-采用itext导出文档到word.</p> * <p>优缺点-可将随意控制生成word的格式,但代码控制上比采用模板的方式稍微复杂,可设置页眉页脚等其他文档属性.</p> * <p>第三方jar-itext-2.1.7.jar.itext-rtf-2.1.7.jar.<br> * import com.lowagie.text.Document;<br> * im

【反射】Class Field Method Constructor

Class public final class java.lang.Class<T> extends Object implements Serializable, GenericDeclaration, Type, AnnotatedElement 类型参数 T:由此 Class 对象建模的类的类型.例如, String.class 的类型是 Class<String>.如果将被建模的类未知,则使用 Class<?>. Instances of the class

Position Independent Code (PIC) in shared libraries【转载】

I've described the need for special handling of shared libraries while loading them into the process's address space in a previous article. Briefly, when the linker creates a shared library, it doesn't know in advance where it might be loaded. This c

【Leetcode】【Easy】Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is defined as a character sequence consists of non-space cha

【leetcode】Maximum Product of Word Lengths

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, return 0. Example

【leetcode】length of last word (easy)

题目: 输入字符串 s,返回其最后一个单词的长度 如 s="Hello World"   返回5 s="Hello World    "   返回5 s="  "     返回0 开始从前向后判断,超时了.改成从后向前判断,通过了. class Solution { public: int lengthOfLastWord(const char *s) { int length = 0; int slen = strlen(s); for(int

【HDOJ】3732 Ahui Writes Word

初看01背包,果断TLE.是因为n和C都比较大.但是vi和ci却很小,转化为多重背包. 1 #include <cstdio> 2 #include <cstring> 3 4 int map[15][15]; 5 int dp[10005]; 6 int n, C; 7 8 int max(int a, int b) { 9 return a>b ? a:b; 10 } 11 12 void ZeroOnePack(int v, int c) { 13 for (int i