跳到主要内容

SaveFile

Saves the file after all the changes are made. The type of the file which will be saved needs to be set.

Syntax

HRESULT SaveFile([in] BSTR type, [in] BSTR path, [out, retval] VARIANT_BOOL* result);

Parameters

NameTypeDescription
typeBSTRThe file extension. The following values are possible: docx, odt, rtf, txt, pptx, xlsx, ods, csv, pdf (see OFFICESTUDIO_FILE_XXX values).
pathBSTRThe path to the file to be saved together with its name and extension.
resultVARIANT_BOOL*Specifies if the operation of saving a file is successful or not.

Example

COM

CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
VARIANT_BOOL b;
oBuilder->Initialize();
oBuilder->SaveFile("docx", "result.docx", &b);
oBuilder->Dispose();

.docbuilder

builder.SaveFile("docx", "result.docx")