VBA宏,用于在Word 2013中的标题编号前添加空行

VBA宏,用于在Word 2013中的标题编号前添加空行,vba,ms-word,Vba,Ms Word,相当有经验的Excel VBA编码器,Word宏新手 我有一个Word 2013文档输出,其中包含近300个编号段落,所有段落都以最少的格式运行。段落编号都从第1列开始,整个文本段落在5个空格的一个选项卡上移动,直到下一个编号回到第1列,依此类推。在文档结束之前,没有空行 有没有一种方法可以编写一个循环遍历整个文档的宏,如果它在第1列中找到一个数字,那么它会在前面添加一个空行 非常感谢您的帮助。据我所知,您的文档如下所示: 1 Heading test test test 2 O

相当有经验的Excel VBA编码器,Word宏新手

我有一个Word 2013文档输出,其中包含近300个编号段落,所有段落都以最少的格式运行。段落编号都从第1列开始,整个文本段落在5个空格的一个选项卡上移动,直到下一个编号回到第1列,依此类推。在文档结束之前,没有空行

有没有一种方法可以编写一个循环遍历整个文档的宏,如果它在第1列中找到一个数字,那么它会在前面添加一个空行


非常感谢您的帮助。

据我所知,您的文档如下所示:

1     Heading
test test test
2     Other heading
test test test
test 33test test
test test test2
test test test
test 44 test test
test test test
3     Other heading
. <- would represent a empty line 
1     Heading
test test test

2     Other heading
test test test
test 33test test
test test test2
test test test
test 44test test
test test test

3     Other heading
你希望它是这样的:

1     Heading
test test test
2     Other heading
test test test
test 33test test
test test test2
test test test
test 44 test test
test test test
3     Other heading
. <- would represent a empty line 
1     Heading
test test test

2     Other heading
test test test
test 33test test
test test test2
test test test
test 44test test
test test test

3     Other heading

有关如何使用此功能的更多信息,请查看此页面:

据我所知,您的文档如下所示:

1     Heading
test test test
2     Other heading
test test test
test 33test test
test test test2
test test test
test 44 test test
test test test
3     Other heading
. <- would represent a empty line 
1     Heading
test test test

2     Other heading
test test test
test 33test test
test test test2
test test test
test 44test test
test test test

3     Other heading
你希望它是这样的:

1     Heading
test test test
2     Other heading
test test test
test 33test test
test test test2
test test test
test 44 test test
test test test
3     Other heading
. <- would represent a empty line 
1     Heading
test test test

2     Other heading
test test test
test 33test test
test test test2
test test test
test 44test test
test test test

3     Other heading

有关如何使用此功能的更多信息,请查看此页面:

数字是否为实际项目符号?没有项目符号,只是从1开始编号。和一个标题,然后文本作为缩进段落,后跟2。还有一个标题,以此类推。这些数字是实际的项目符号吗?没有项目符号,只是从1开始编号。和一个标题,然后文本作为缩进段落,后跟2。还有一个标题,等等。谢谢,我会继续研究这个解决方案。首先,它失败了,因为文本中也有数字。有没有办法在一行的开头指定一个数字或限制在第1-2列?我已经根据您的新要求更新了我的答案。第一个标题不适用于这种方法。我想这仍然是一个可行的解决方案。谢谢,我会继续研究这个解决方案。首先,它失败了,因为文本中也有数字。有没有办法在一行的开头指定一个数字或限制在第1-2列?我已经根据您的新要求更新了我的答案。第一个标题不适用于这种方法。我想这仍然是一个可行的解决方案。