GetProperty
Returns a property of the CDocBuilderValue object.
Please note, that for the
.docbuilderfile theCDocBuilderValue.GetPropertymethod is not used.
Syntax
CDocBuilderValue^ GetProperty(String^ sName);
Parameters
| Parameter | Type | Description |
|---|---|---|
| sName | String^ | The name of the CDocBuilderValue object property. |
Example
.Net
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
CContext oContext = oBuilder.GetContext();
CValue oGlobal = oContext.GetGlobal();
CValue oApi = oGlobal["Api"];
CValue oDocument = oApi.Call("GetDocument");
CValue oDocPr = oDocument.GetProperty("color");
CDocBuilder.Destroy();
There are two more ways to get a property of the CDocBuilderValue object:
-
use the
Getmethod that takes an argument in the string format:CDocBuilderValue^ Get(String^ name);Example
.Net
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
CContext oContext = oBuilder.GetContext();
CValue oGlobal = oContext.GetGlobal();
CValue oApi = oGlobal["Api"];
CValue oDocument = oApi.Call("GetDocument");
CValue oDocPr = oDocument.Get("color");
CDocBuilder.Destroy(); -
use the
default[]postfix expression that takes an argument in the string format:property CDocBuilderValue^ default[String^]Example
.Net
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
CContext oContext = oBuilder.GetContext();
CValue oGlobal = oContext.GetGlobal();
CValue oApi = oGlobal["Api"];
CValue oDocument = oApi.Call("GetDocument");
CValue oDocPr = oDocument["color"];
CDocBuilder.Destroy();