微软文本检索_如何在Microsoft Word中引用其他文档中的文本

本文档详细介绍了如何在Microsoft Word中创建一个通用文档,存储常用文本如地址,并使用INCLUDETEXT域代码在其他文档中自动插入和更新这些内容。通过设置书签并引用书签,你可以实现文本的自动更新,避免手动复制粘贴。
摘要由CSDN通过智能技术生成
微软文本检索

微软文本检索

00_lead_image_common_information

You probably have some text that you type often in your Word documents, such as addresses. Instead of retyping this text every time you need it, you can put this common text into one Word document and reference it in other documents–it’ll even automatically update in all your documents if you change it.

您可能有一些经常在Word文档中键入的文本,例如地址。 您可以将此通用文本放入一个Word文档中,并在其他文档中进行引用,而不必每次都重新键入该文本,如果更改,它甚至会在所有文档中自动更新。

Say you want to put your address in the footer of your documents, but the address changes from time to time. You can store the address in a separate, common Word document and use a field in your report to pull the text from the common document, and update whenever it changes. We’ll show you how to do this.

假设您想将地址放在文档的页脚中,但是地址会不时更改。 您可以将地址存储在单独的通用Word文档中,并在报告中使用字段从通用文档中提取文本,并在更改时进行更新。 我们将向您展示如何执行此操作。

To begin, create a new Word document that will serve as your repository for the address you want to insert into other Word documents. Save it in a location that will be accessible by other documents. For example, don’t save it on a network drive to which you don’t always have access.

首先,创建一个新的Word文档,它将用作您要插入其他Word文档中的地址的存储库。 将其保存在其他文档可以访问的位置。 例如,不要将其保存在并非总是具有访问权限的网络驱动器上。

We’re going to use bookmarks to refer to the address in our common document. Type the string of text you want to insert into other documents (in our case, the address). Create a bookmark by highlighting the name and going to Insert > Bookmark and giving it a name, like “Address”. See our guide to bookmarks in Word for information on creating them.

我们将使用书签来引用我们的普通文档中的地址。 键入要插入其他文档的文本字符串(在我们的示例中为地址)。 通过突出显示名称并转到插入>书签并为其命名,例如“地址”,来创建书签。 有关创建书签的信息,请参见Word中的书签指南

Note that bookmark names cannot have any spaces. We recommend putting the name of the bookmark above each item in your common information file so you easily know which name to use for which item. This is especially useful if you plan to have a lot of reusable items in this common document. In our example, we added our address to the common information document and put the bookmark name, “Address”, above the item.

请注意,书签名称不能有任何空格。 我们建议将书签的名称放在公共信息文件中每个项目的上方,以便您轻松知道要为哪个项目使用哪个名称。 如果您打算在此公共文档中有很多可重复使用的项目,则此功能特别有用。 在我们的示例中,我们将地址添加到公共信息文档中,并将书签名称“地址”放在项目上方。

01_creating_bookmark_in_common_file

Once you’ve added the item to your common document, you can save and close. Open the document in which you want to insert the address and position the cursor where you want that text to go. For our example, we’re going to add a footer and insert the address there.

将项目添加到普通文档后,即可保存并关闭。 打开您要在其中插入地址的文档,然后将光标置于您要输入文本的位置。 对于我们的示例,我们将添加一个页脚并在其中插入地址。

02_placing_cursor_in_footer

We’re going to use the INCLUDETEXT field code to refer to the bookmark we created in the common document. To do this, press “Ctrl + F9” to insert the brackets for the field code.

我们将使用INCLUDETEXT域代码来引用我们在通用文档中创建的书签。 为此,请按“ Ctrl + F9”以插入域代码的括号。

NOTE: You cannot just type normal brackets around field codes. You must use “Ctrl + F9” to insert the correct type of brackets.

注意:您不能只在域代码周围输入普通括号。 您必须使用“ Ctrl + F9”插入正确的括号类型。

03_pressing_ctrl_f9_for_brackets

The cursor is automatically placed in between the brackets. Type the following text between the brackets, replacing the “<path to file>” with the absolute full path to your common Word containing the name you want to insert. Replace “<bookmark name>” with the bookmark name you assigned to the item in the common document.

光标会自动放在括号之间。 在方括号之间键入以下文本,将“ <文件路径>”替换为包含要插入名称的通用Word的绝对完整路径。 将“ <书签名称>”替换为您为普通文档中的项目分配的书签名称。

INCLUDETEXT "<path to file>" <bookmark name>

NOTE: Do not enter the brackets in the field code.

注意:请勿在域代码中输入括号。

For example, we typed the following in between the field code brackets:

例如,我们在域代码括号之间键入以下内容:

INCLUDETEXT "C:\\Users\\Lori\\Documents\\Common Information\\CommonInformation.docx" Address

NOTE: You must use double backslashes in the path, like we did. Also, make sure you use straight quotes, not smart quotes, when typing the above code into the field.

注意:必须像我们一样在路径中使用双反斜杠。 另外,在字段中键入上述代码时,请确保使用直引号而不是智能引号。

04_entering_includetext_field_code

To grab the address from the common document and insert it into the field code you just entered, right-click on the field code and select “Update Field” from the popup menu.

要从通用文档中获取地址并将其插入刚输入的域代码中,请右键单击该域代码,然后从弹出菜单中选择“更新域”。

05_selecting_update_field

The address displays in the document. Brackets still display around the address if you have the “Show bookmarks” option on. Again, see our article about bookmarks to learn how to turn off this option. Also, the field code might be shaded. However, you can also turn this off.

地址显示在文档中。 如果您启用了“显示书签”选项,则括号仍会显示在地址周围。 同样,请参阅我们有关书签文章,以了解如何关闭此选项。 此外,该域代码可能会被加阴影。 但是,您也可以关闭此功能

06_text_inserted

If you want to change the field code, you can display the code again rather than the result. To do this, right-click on the resulting item and select “Toggle Field Codes” from the popup menu. The text you typed into the field code displays again and you can edit it. Simply, update the field to display the new result.

如果要更改域代码,可以再次显示该代码而不是结果。 为此,右键单击生成的项目,然后从弹出菜单中选择“切换域代码”。 您在域代码中键入的文本将再次显示,您可以对其进行编辑。 只需更新字段以显示新结果。

07_selecting_toggle_field_codes

Once you’ve created your common document, you can use it to store other items you often type into your Word documents. Simply use a separate INCLUDETEXT field in your Word documents for each piece of information you want to automatically insert from your common document.

一旦创建了通用文档,就可以使用它存储您经常在Word文档中键入的其他项目。 只需在Word文档中使用单独的INCLUDETEXT字段,即可获取要从普通文档中自动插入的每条信息。

翻译自: https://www.howtogeek.com/240026/how-to-reference-text-from-other-documents-in-microsoft-word/

微软文本检索

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Word是文字处理软件,我们在日常处理一些文字时经常遇到一些问题,如:各种公式的录入,尽管Word都提供了“公式编辑器”,但其插入的却是“对象”,有时排版会感觉不方便,而且也不适合大量、重复的公式录入。根据经验,只要在Word善于使用“域”,并结合Windows的“剪贴板”,就能快速、方便、简捷地录入各种公式。 要使用域,我们必须知道什么是域?域是一种特殊代码,用来指导WORD文档自动插入文字、图形、页码和其他资料。我们在日常文字处理经常遇到一些简单域,只是没有引起我们的注意,域相当于文档可能发生变化的数据或邮件合并文档套用信函、标签的占位符。 域有三种类型:结果域、行为域和标记域。结果域是以插入信息的方法在文档产生结果;行为域是对文档做一些操作但不插入可见的文本;标记域既不产生结果也不发生行为。 域的组成:结果域通常是由域代码域结果组成。 如:{includetext ―C:\\ls\zhls1123.doc‖},includetext是域类型,“C:\\ls\zh123.doc”是域指令。它表示在文档每个出现此域代码的地方就会插入名为“zh123.doc‖的文档。域结果是当Word执行域的指令时在文档生成具体的文本、数字、图形。 域最大的特点就是域内容可以根据文档的改动或其他有关因素的变化而自动更新。Word提供了9大类共74种域,其IF有两处、Compare域有两处,均在“文档自动化”和“邮件合并”。好了我们下面开始学习有关的域。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值