Word导航窗格功能的VBA代码'选择标题和内容' [英] VBA Code for Word Navigation Pane Function 'Select Heading and Content'

查看:1208
本文介绍了Word导航窗格功能的VBA代码'选择标题和内容'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好, 
$


一般来说,我是VBA编程的新手,所以希望有人能在这里帮助我。



我想写一个实际上与导航窗格功能相同的宏'选择标题和Word中的内容'。我试图通过使用宏录制器来捕获此代码,但不幸的是,这并没有捕获任何内容。



可以说我确实有以下文档结构。



1.准备工作

1.1 准备工作A

1.2 准备B b
2 。安装

2.1步骤A
$
2.2步骤B

$
由当前选择的相应章节给出应选择相关的子章节和属于它的文本。



例如 

选择是"1。制备" - >  第1章以及所有子章节(1.1&和1.2)被选中.b
选择是"1.1准备"。 - >选择第1.1章,因为没有子章节 

Hello,  

I am a newbie when it comes to VBA programming in general, so hopefully someone here can help me out here.

I would like to write a macro which actually does the same as the Navigation Pane Function 'Select Heading and Content' in Word. I tried to capture this code by using the macro recorder but unfortunatelly this does not capture anything.

Lets say I do have the following document structure.

1. Preparation
1.1  Preperation A
1.2  Preperation B
2. Installation
2.1 Step A
2.2 Step B

Given by the current selection of the corressponding chapter all related subchapters and texts belonging to it should be selected.

eg. 
Selection is "1. Preparation" -->  Chapter 1 as well all sub chapters (1.1 && 1.2) are selected
Selection is "1.1 Preparation" --> Chapter 1.1 is selected since there are no sub chapters 

非常感谢您的帮助。

谢谢André

推荐答案

也许你不需要VBA。我的单词不是英文,但尝试在任何窗格主题中单击鼠标右键,然后在"选择标题和内容"中单击。 (或类似的东西)。它将根据您的需要进行选择。

Maybe you don't need VBA. My word is not in english, but try clicking with right mouse button in any pane topic and then in "Select Title and Content" (or something like that). It will select just like you want.


这篇关于Word导航窗格功能的VBA代码'选择标题和内容'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆