SaveFile

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

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

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")

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).