本文介绍了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é

推荐答案


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

08-31 09:46