[]
An IDocumentProperty exposes workbook metadata such as the property name, value, type, and whether a custom property is linked to worksheet content. Custom properties can be created directly or linked to a named range so the property value reflects the referenced cell content.
worksheet.getRange("A1").setValue("Hello");
workbook.getNames().add("Headings", "=Sheet1!$A$1");
IDocumentProperty property = workbook.getCustomDocumentProperties().addLinkToContent("Title", "Headings");
Object value = property.getValue();
booleangetName()getType()getValue()voidReturns the name assigned to a built-in or custom document property.
worksheet.getRange("A1").setValue("Hello");
workbook.getNames().add("Headings", "=Sheet1!$A$1");
IDocumentProperty property = workbook.getCustomDocumentProperties().addLinkToContent("Title", "Headings");
String name = property.getName();
Returns the current value stored in this document property. For a property created by linking to content, the returned value reflects the linked content value.
worksheet.getRange("A1").setValue("Hello");
workbook.getNames().add("Headings", "=Sheet1!$A$1");
IDocumentProperty property = workbook.getCustomDocumentProperties().addLinkToContent("Title", "Headings");
Object value = property.getValue();
Sets the current value stored in this document property. For a property created by linking to content, the value being set becomes the current property value.
IDocumentProperty property = workbook.getCustomDocumentProperties().add("Name", "Headings");
property.setValue(100);
value - The value of the property.A linked document property is typically created by ICustomDocumentPropertyCollection.addLinkToContent(String,String) and uses a named range as its content source.
worksheet.getRange("A1").setValue("Hello");
workbook.getNames().add("Headings", "=Sheet1!$A$1");
IDocumentProperty property = workbook.getCustomDocumentProperties().addLinkToContent("Title", "Headings");
boolean linkToContent = property.getLinkToContent();
true if this property is linked to workbook content; otherwise, false.For a property created by ICustomDocumentPropertyCollection.addLinkToContent(String,String), the returned string identifies the named range used as the content source.
worksheet.getRange("A1").setValue("Hello");
workbook.getNames().add("Headings", "=Sheet1!$A$1");
IDocumentProperty property = workbook.getCustomDocumentProperties().addLinkToContent("Title", "Headings");
String source = property.getLinkSource();
Use this method to determine which PropertyType is associated with the current built-in or custom document property.
worksheet.getRange("A1").setValue("Hello");
workbook.getNames().add("Headings", "=Sheet1!$A$1");
IDocumentProperty property = workbook.getCustomDocumentProperties().addLinkToContent("Title", "Headings");
PropertyType type = property.getType();
PropertyType of the document property.