Back to Devexpress

DocumentCustomProperties.LinkToContent(String, String) Method

officefileapi-devexpress-dot-spreadsheet-dot-documentcustomproperties-dot-linktocontent-x28-system-dot-string-system-dot-string-x29.md

latest3.8 KB
Original Source

DocumentCustomProperties.LinkToContent(String, String) Method

Links a custom document property to the cell or cell range content.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void LinkToContent(
    string name,
    string linkTarget
)
vb
Sub LinkToContent(
    name As String,
    linkTarget As String
)

Parameters

NameTypeDescription
nameString

A string value that is the name of the custom document property.

| | linkTarget | String |

A string value that is the defined name of the cell or cell range to be linked to the custom property.

|

Remarks

This method is available only to custom document properties (accessible using the DocumentProperties.Custom property).

If the custom property with the name passed as the name method parameter doesn’t exist, it is created automatically.

The custom property linked to the named cell range returns the value of the range’s upper-left cell.

Example

View Example

csharp
//Define a name to the cell to be linked to the custom property
workbook.DefinedNames.Add("checked_by", "E6");

//Connect the custom property with the named cell
workbook.DocumentProperties.Custom.LinkToContent("Checked by", "checked_by");
vb
'Define a name to the cell to be linked to the custom property
workbook.DefinedNames.Add("checked_by", "E6")

'Connect the custom property with the named cell
workbook.DocumentProperties.Custom.LinkToContent("Checked by", "checked_by")

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LinkToContent(String, String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

spreadsheet-document-api-examples-part1/VB/SpreadsheetExamples/SpreadsheetActions/DocumentPropertiesActions.vb#L68

vb
' Connect the custom property with the named cell.
                workbook.DocumentProperties.Custom.LinkToContent("Checked by", "checked_by")
#End Region ' #LinkToContent

See Also

Defined Names

DocumentCustomProperties Interface

DocumentCustomProperties Members

DevExpress.Spreadsheet Namespace