Field codes: Link field

The Link field links information from another application to your Word document by using OLE (OLE: A program-integration technology that you can use to share information between programs. All Office programs support OLE, so you can share information through linked and embedded objects.). Microsoft Word inserts this field when you copy information from another application and paste it into a Word document by using the Paste Special command (Home tab, Clipboard group, Paste command arrow button).

Security  Because field codes can be visible to anyone reading your document, be sure that the information you place in field codes is not information that you want kept private.

Syntax

When you view the FieldName field in your document, the syntax looks like this:

{ LINK ClassName "FileName" [PlaceReference ] [Switches ] }

 Note    A field code tells the field what to show. Field results are what’s shown in the document after having evaluated the field code. To toggle between viewing the field code and the field code results, press Alt+F9.

Instructions

ClassName

The application type of the linked information. For example, for a Microsoft Excel chart, ClassName is "Excel.Chart.8." Word determines this information from the source application.

"FileName"

The name and location of the source file. If the location includes a long file name with spaces, enclose it in quotation marks. Replace single backslashes with double backslashes to specify the path (path: The route that the operating system uses to locate a folder or file; for example, C:\House finances\March.doc.), for example:

"C:\\MSOffice\\Excel\\Rfp\\Budget.xls"

PlaceReference

Identifies the portion of the source file that's being linked. If the source file is a Microsoft Excel workbook, the reference can be a cell reference or a named range. If the source file is a Word document, the reference is a bookmark (bookmark: A location or selection of text in a file that you name for reference purposes. Bookmarks identify a location within your file that you can later refer or link to.).

Switches

\a

Updates the LINK field automatically; delete this switch to use manual updating.

\b

Inserts the linked object as a bitmap.

\d

Graphic data isn't stored with the document, thus reducing the file size.

\f

Causes the linked object (linked object: An object that is created in a source file and inserted into a destination file, while maintaining a connection between the two files. The linked object in the destination file can be updated when the source file is updated.) to update its formatting in a particular way, according to one of the following parameters.

This value Specifies
0 Maintain the formatting of the source file
1 Not supported
2 Match the formatting of the destination document
3 Not supported
4 Maintain the formatting of the source file, if the source file is an Excel workbook
5 Match the formatting of the destination document, if the source file is an Excel workbook

\h

Inserts the linked object as HTML (HTML: The standard markup language used for documents on the World Wide Web. HTML uses tags to indicate how Web browsers should display page elements such as text and graphics and how to respond to user actions.) format text.

\p

Inserts the linked object (linked object: An object that is created in a source file and inserted into a destination file, while maintaining a connection between the two files. The linked object in the destination file can be updated when the source file is updated.) as a picture.

\r

Inserts the linked object in rich-text format (RTF) (rich text format (RTF): A file type used to transfer formatted text documents between applications, even those that run on different platforms, such as IBM and Macintosh.).

\t

Inserts the linked object in text-only format.

\u

Inserts the linked object as Unicode (Unicode: A character encoding standard developed by the Unicode Consortium. By using more than one byte to represent each character, Unicode enables almost all of the written languages in the world to be represented by using a single character set.) text.

Example

The following example inserts a range of cells from a Microsoft Excel worksheet. The \a switch ensures that the information is updated in Word whenever the worksheet is changed in Microsoft Excel:

{ LINK Excel.Sheet.8 "C:\\My Documents\\Profits.xls" "Sheet1!R1C1:R4C4" \a \p }

 
 
Applies to:
Word 2013, Word 2010, Word 2007