Syntax
EditLinks [.UpdateMode = number,] [.Locked = number,] [.SavePictureInDoc = number,] [.UpdateNow,] [.OpenSource,] [.KillLink,] .Link = text, .Application = text, .Item = text, .FileName = text
Remarks
Sets options for the specified link. The arguments for the Link statement correspond to the options in the Links dialog box (Edit menu).
Argument | Explanation | |
.UpdateMode | Specifies how the link is updated: 0 (zero) Automatically | |
.Locked | Specifies whether to lock or unlock the link: 0 (zero) Unlock the link | |
.SavePictureInDoc | If 1, saves a copy of the linked object in the Word document | |
.UpdateNow | Updates the specified link | |
.OpenSource | Opens the source of the specified link (for example, a Microsoft Excel worksheet) | |
.KillLink | Replaces the specified link with its most recent result | |
.Link | Specifies the link listed in the Links dialog box whose options are to be set: "1" corresponds to the first link in the list, "2" corresponds to the second, and so on. Note that the number must be enclosed in quotation marks. You can also use the "\ Sel" predefined bookmark to specify the currently selected link. | |
.Application | The type of document supplying the link, as it appears in the LINK field codes — for example, "Word.Document.6" for a Word document or "Excel.Sheet.5" for a Microsoft Excel 5.0 worksheet. | |
.Item | Text that identifies the linked information (for example, a bookmark name such as "INTERN_LINK2" in a Word document, or a range of cells such as R1C1:R5C3 in a Microsoft Excel worksheet) | |
.FileName | The path and filename of the source document containing the linked item |
The last three arguments correspond to choosing the Change Source button and setting options in the Change Source dialog box.
Examples
This example unlocks an existing link to a Microsoft Excel 5.0 worksheet and makes updating automatic. On the Macintosh, substitute a path and filename such as HD:WORKSHEETS:SALES.
EditLinks .UpdateMode = 0, .Locked = 0, .Link = "\Sel", \ .Application = "Excel.Sheet.5", .Item = "Sales Report!R1C1:R5C3", \ .FileName = "C:\EXCEL5\EXAMPLES\SALES.XLS"
The following example selects each link between the active document and a Microsoft Excel 5.0 worksheet and makes updating manual:
StartOfDocument ViewFieldCodes 1 EditFind "^d LINK Excel.Sheet.5", .Format = 0, .Wrap = 0 While EditFindFound() Dim dlg As EditLinks GetCurValues dlg dlg.UpdateMode = 1 EditLinks dlg CharRight RepeatFind Wend
See Also
EditPasteSpecial, EditPublishOptions, EditSubscribeOptions, InsertField, LockFields, UnlinkFields, UnlockFields