CreateScope
Creates a context scope which sets the execution context for all operations executed within a local scope.
note
For the .docbuilder file the CDocBuilderContext.CreateScope method is not used.
Syntax
- Python
- C++
- COM
- Java
- .Net
def CreateScope(self) -> CDocBuilderContextScope
CDocBuilderContextScope CreateScope();
HRESULT CreateScope([out, retval] I_DOCBUILDER_CONTEXT_SCOPE** result);
CDocBuilderContextScope createScope();
CDocBuilderContextScope^ CreateScope();
Parameters
COM only
- COM
| Name | Type | Description |
|---|---|---|
| result | I_DOCBUILDER_CONTEXT_SCOPE** | The returned context scope. |
Example
- Python
- C++
- COM
- Java
- .Net
builder = docbuilder.CDocBuilder()
context = builder.GetContext()
scope = context.CreateScope()
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory();
CDocBuilder::Initialize(sWorkDirectory.c_str());
CDocBuilder oBuilder;
CContext oContext = oBuilder.GetContext();
CContextScope oScope = oContext.CreateScope();
CDocBuilder::Dispose();
CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
IONLYOFFICEDocBuilderContext* oContext = NULL;
IONLYOFFICEDocBuilderContextScope* oScope = NULL;
oBuilder->Initialize();
oBuilder->GetContext(&oContext);
oContext->CreateScope(&oScope);
oBuilder->Dispose();
CDocBuilder.initialize("");
CDocBuilder builder = new CDocBuilder();
CDocBuilderContext context = builder.getContext();
CDocBuilderContextScope scope = context.createScope();
CDocBuilder.dispose();
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
CContext oContext = oBuilder.GetContext();
CContextScope oScope = oContext.CreateScope();
CDocBuilder.Destroy();