如何获取Word文档中特定段落样式的段落计数

如何获取Word文档中特定段落样式的段落计数

You can easily count paragraphs, as well as pages, words, characters, and lines, in a Word document. However, what if you want to know how many paragraphs of a specific style you have in your document? We’ll show you a trick that allows you to easily get this number.

您可以轻松计算Word文档中的段落以及页面,单词,字符和行 。 但是,如果您想知道文档中有多少个特定样式的段落,该怎么办? 我们将向您展示一个技巧,使您可以轻松获取此号码。

For example, maybe you want to know how many warnings you have in your document and you’ve applied a custom style to all the warnings in your document. For this trick, we’re going to use the Find and Replace dialog box to search for paragraph marks on paragraphs with a specific style.

例如,也许您想知道您的文档中有多少警告,并且您已将自定义样式应用于文档中的所有警告。 对于这个技巧,我们将使用“查找和替换”对话框来搜索具有特定样式的段落上的段落标记。

We’ll search for a custom Warning style in our example, but you can search for whatever paragraph style you want to count. Press Ctrl+Home to put the cursor at the beginning of the document. Then, press Ctrl+H to open the Find and Replace dialog box with the Replace tab active. Click “More”.

在示例中,我们将搜索自定义的Warning样式,但您可以搜索要计算的任何段落样式。 按Ctrl + Home,将光标置于文档的开头。 然后,按Ctrl + H打开“替换”选项卡处于活动状态的“查找和替换”对话框。 点击“更多”。

如何获取Word文档中特定段落样式的段落计数

Click the “Format” button at the bottom of the dialog box and select “Style” from the popup menu.

单击对话框底部的“格式”按钮,然后从弹出菜单中选择“样式”。

如何获取Word文档中特定段落样式的段落计数

On the Find Style dialog box, select the style you want to find in the “Find what style” list and then click “OK”.

在“查找样式”对话框中,在“查找样式”列表中选择要查找的样式,然后单击“确定”。

如何获取Word文档中特定段落样式的段落计数

Notice that the name of the selected style displays below the Find what box. Enter ^p in the “Find what” box and in the “Replace with” box. We’re searching for and replacing the same thing: a paragraph mark. Click “Replace All”.

请注意,所选样式的名称显示在“查找内容”框下方。 在“查找内容”框中和“替换为”框中输入^ p。 我们正在寻找并替换相同的东西:一个段落标记。 点击“全部替换”。

如何获取Word文档中特定段落样式的段落计数

Word replaces all paragraph marks on paragraphs with the selected style (the Warning style, in our example) with identical paragraph marks, resulting in no actual changes to your document. However, Word displays a dialog box telling you how many changes were made. This number is the number of paragraphs in your document with the selected style. In our example, we have four warning paragraphs.

Word用相同的段落标记替换具有选定样式(在本示例中为“警告”样式)的段落上的所有段落标记,从而不会对文档进行任何实际更改。 但是,Word将显示一个对话框,告诉您进行了多少更改。 该数字是文档中具有选定样式的段落数。 在我们的示例中,我们有四个警告段落。

如何获取Word文档中特定段落样式的段落计数

This trick also works for counting the total number of paragraphs in your document. Simply skip the step where you select the paragraph style on the Find and Replace document. However, the statistics tool is and easier and faster solution for getting a paragraph count and provides other document statistics as well.

此技巧也可用于计算文档中段落的总数。 只需跳过在“查找和替换”文档上选择段落样式的步骤。 但是, 统计信息工具是获取段落计数的便捷且快速的解决方案,并且还提供其他文档统计信息。

翻译自: https://www.howtogeek.com/262591/how-to-get-a-paragraph-count-for-a-specific-paragraph-style-in-a-word-document/