跳到主要内容

WriteData

Writes data to the log file. It is used for logs in JS code.

Please note, that for the .docbuilder file the CDocBuilder.WriteData method is not used.

Syntax

HRESULT WriteData([in] BSTR path, [in] BSTR value, [in] VARIANT_BOOL append);

Parameters

NameTypeDescription
pathBSTRThe path to the file where all the logs will be written.
valueBSTRThe data which will be written to the log file.
appendVARIANT_BOOLSpecifies if the new data will be appended to the already existing log file or a new file will be created.

Example

COM

CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
oBuilder->Initialize();
oBuilder->WriteData("result.log", "Alert!", false);
oBuilder->Dispose();