Get
Returns an array value by its index.
Please note, that for the
.docbuilderfile theCDocBuilderValue.Getmethod is not used.
Syntax
HRESULT Get([in] long index, [out, retval] I_DOCBUILDER_VALUE** result);
Parameters
| Parameter | Type | Description |
|---|---|---|
| index | long | The index of the array value. |
| result | I_DOCBUILDER_VALUE** | The returned array value. |
Example
- COM
- .docbuilder
CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
IONLYOFFICEDocBuilderContext* oContext = NULL;
IONLYOFFICEDocBuilderValue* oGlobal = NULL;
IONLYOFFICEDocBuilderValue* oApi = NULL;
IONLYOFFICEDocBuilderValue* oDocument = NULL;
IONLYOFFICEDocBuilderValue* aCharts = NULL;
IONLYOFFICEDocBuilderValue* oChart = NULL;
oBuilder->Initialize();
oBuilder->GetContext(&oContext);
oContext->GetGlobal(&oGlobal);
oGlobal->GetProperty(_bstr_t("Api"), &oApi);
oApi->Call(_bstr_t("GetDocument"), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), &oDocument);
oDocument->Call(_bstr_t("GetAllCharts"), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), ATL::CComVariant(), &aCharts);
aCharts->Get(1, &oChart);
oBuilder->Dispose();
let doc = Api.GetDocument();
let charts = doc.GetAllCharts();
let chart = charts[1];