LinkToContent Property (DocumentProperty Object)

Applies To

DocumentProperty Object.

Description

True if the value of a custom document property is linked to the content of the container document; False if the value is static. 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

This property applies only to custom document properties. For built-in document properties, this property is always False.

Use the LinkSource property to set the source for the linked property. 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 displays the linked status for each custom document property as a list on worksheet one.


rw = 1
With Worksheets(1)
    For Each pro In ActiveWorkbook.CustomDocumentProperties
        .Cells(rw, 1) = pro.Name
        .Cells(rw, 2) = pro.LinkToContent
        If pro.LinkToContent Then
            .Cells(rw, 3) = pro.LinkSource
        End If
        rw = rw + 1
    Next
End With