DocumentPropertyIsLinkToContent Property |
Namespace: Aspose.Words.Properties
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.StartBookmark("MyBookmark"); builder.Writeln("Text inside a bookmark."); builder.EndBookmark("MyBookmark"); // Add linked to content property CustomDocumentProperties customProperties = doc.CustomDocumentProperties; DocumentProperty customProperty = customProperties.AddLinkToContent("Bookmark", "MyBookmark"); // Check whether the property is linked to content Assert.AreEqual(true, customProperty.IsLinkToContent); // Get the source of the property Assert.AreEqual("MyBookmark", customProperty.LinkSource); // Get the value of the property Assert.AreEqual("Text inside a bookmark.\r", customProperty.Value); doc.Save(ArtifactsDir + "Properties.LinkCustomDocumentPropertiesToBookmark.docx");