GetGlobal
Returns the global object for the current context.
note
For the .docbuilder file the CDocBuilderContext.GetGlobal method is not used.
Syntax
- Python
- C++
- COM
- Java
- .Net
def GetGlobal(self) -> CDocBuilderValue
CDocBuilderValue GetGlobal();
HRESULT GetGlobal([out, retval] I_DOCBUILDER_VALUE** result);
CDocBuilderValue getGlobal();
CDocBuilderValue^ GetGlobal();
Parameters
COM only
- COM
| Name | Type | Description |
|---|---|---|
| result | I_DOCBUILDER_VALUE** | The returned global object |
Example
- Python
- C++
- COM
- Java
- .Net
builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory();
CDocBuilder::Initialize(sWorkDirectory.c_str());
CDocBuilder oBuilder;
CContext oContext = oBuilder.GetContext();
CValue oGlobal = oContext.GetGlobal();
CDocBuilder::Dispose();
CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
IONLYOFFICEDocBuilderContext* oContext = NULL;
IONLYOFFICEDocBuilderValue* oGlobal = NULL;
oBuilder->Initialize();
oBuilder->GetContext(&oContext);
oContext->GetGlobal(&oGlobal);
oBuilder->Dispose();
CDocBuilder.initialize("");
CDocBuilder builder = new CDocBuilder();
CDocBuilderContext context = builder.getContext();
CDocBuilderValue global = context.getGlobal();
CDocBuilder.dispose();
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
CContext oContext = oBuilder.GetContext();
CValue oGlobal = oContext.GetGlobal();
CDocBuilder.Destroy();