LinkSource Property (DocumentProperty Object)

Applies To

DocumentProperty Object.

Description

Returns or sets the source of a linked custom document property. Read-write.

To use this property, you should establish a reference to the Microsoft Office 95 Object Library by using the References command (Tools menu).

Remarks

The source of a link is defined by the container application. For Microsoft Excel, the source is the name in the workbook.

This property cannot be used with built-in document properties.

Setting the LinkSource property sets the LinkToContent property to True.

Example

This example displays the linked status of a custom document property. You must pass a DocumentProperty object to the procedure.


Sub DisplayLinkStatus(dp As DocumentProperty)
    Dim stat As String, tf As String
    If dp.LinkToContent Then
        tf = ""
    Else
        tf = "not "
    End If
    stat = "This property is " & tf & "linked"
    If dp.LinkToContent Then
        stat = stat + Chr(13) & "The link source is " & dp.LinkSource
    End If
    MsgBox stat
End Sub

This example links the custom document property named "TotalSales" to the named range "SalesNumbers" in the active workbook.


ActiveWorkbook.CustomDocumentProperties _
    .Item("TotalSales").LinkSource = "SalesNumbers"