Call
Calls the specified Document Builder method. See the Text document API, Spreadsheet API, Presentation API, or Form API sections for more information which methods are available for various document types.
Please note, that for the
.docbuilderfile theCDocBuilderValue.Callmethod is not used explicitly. The method itself is used instead. See the example below.
Syntax
- Python
- C++
- COM
- Java
- .Net
def Call(self, name: str, *args) -> CDocBuilderValue
CDocBuilderValue Call(const wchar_t* sName, CDocBuilderValue p1, CDocBuilderValue p2, CDocBuilderValue p3, CDocBuilderValue p4, CDocBuilderValue p5, CDocBuilderValue p6);
CDocBuilderValue Call(const char* sName, CDocBuilderValue p1, CDocBuilderValue p2, CDocBuilderValue p3, CDocBuilderValue p4, CDocBuilderValue p5, CDocBuilderValue p6);
HRESULT Call([in] BSTR name, [in, optional] VARIANT val1, [in, optional] VARIANT val2, [in, optional] VARIANT val3, [in, optional] VARIANT val4, [in, optional] VARIANT val5, [in, optional] VARIANT val6, [out, retval] I_DOCBUILDER_VALUE** result);
CDocBuilderValue call(String name, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6);
CDocBuilderValue^ Call(String^ sName, CDocBuilderValue^ p1, CDocBuilderValue^ p2, CDocBuilderValue^ p3, CDocBuilderValue^ p4, CDocBuilderValue^ p5, CDocBuilderValue^ p6);
Parameters
- Python
- C++
- COM
- Java
- .Net
| Name | Type | Description |
|---|---|---|
| name | str | The name of the Document Builder method. |
| *args | CDocBuilderValue | The parameters that the Document Builder method takes as arguments. |
| Name | Type | Description |
|---|---|---|
| sName | const wchar_t* | const char* | The name of the Document Builder method in Unicode or UTF8 format. |
| p1-p6 | CDocBuilderValue | The parameters that the Document Builder method takes as arguments. |
| Name | Type | Description |
|---|---|---|
| name | BSTR | The name of the Document Builder method. |
| val1-val6 | VARIANT | The parameters that the Document Builder method takes as arguments. |
| result | I_DOCBUILDER_VALUE** | The returned method value. |
| Name | Type | Description |
|---|---|---|
| name | String | The name of the Document Builder method. |
| p1-p6 | Object | The parameters that the Document Builder method takes as arguments. |
| Name | Type | Description |
|---|---|---|
| sName | String^ | The name of the Document Builder method. |
| p1-p6 | CDocBuilderValue^ | The parameters that the Document Builder method takes as arguments. |
Example
- Python
- C++
- COM
- Java
- .Net
- .docbuilder
builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
api = globalObj["Api"]
document = api.Call("GetDocument")
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory();
CDocBuilder::Initialize(sWorkDirectory.c_str());
CDocBuilder oBuilder;
CContext oContext = oBuilder.GetContext();
CValue oGlobal = oContext.GetGlobal();
CValue oApi = oGlobal["Api"];
CValue oDocument = oApi.Call("GetDocument");
CDocBuilder::Dispose();
CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
IONLYOFFICEDocBuilderContext* oContext = NULL;
IONLYOFFICEDocBuilderValue* oGlobal = NULL;
IONLYOFFICEDocBuilderValue* oApi = NULL;
IONLYOFFICEDocBuilderValue* oDocument = 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);
oBuilder->Dispose();
CDocBuilder.initialize("");
CDocBuilder builder = new CDocBuilder();
CDocBuilderContext context = builder.getContext();
CDocBuilderValue global = context.getGlobal();
CDocBuilderValue api = global.get("Api");
CDocBuilderValue doc = api.call("GetDocument");
CDocBuilder.dispose();
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");
CDocBuilder.Destroy();
let doc = Api.GetDocument();