GetProperty
Returns a property of the CDocBuilderValue object.
Please note, that for the .docbuilder file the CDocBuilderValue.GetProperty method is not used.
Parameters:
Name |
Type |
Description |
sName |
String^ |
The name of the CDocBuilderValue object property. |
Example
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 Get method that takes an argument in the string format:
CDocBuilderValue^ Get(String^ name);
Example
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
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();