MS Docx File Helpers

class ozcore.core.office.docx.docx.Docx[source]

Microsoft docx files helper class

usage:

from ozcore.core import office
office.word.combine_docx_files(folder="some-folder")
combine_docx_files(folder: Optional[Union[str, pathlib.PosixPath]] = None, files: Optional[Union[List[str], List[pathlib.PosixPath]]] = None, save_to_folder: Optional[Union[str, pathlib.PosixPath]] = None)[source]

Combine multiple documents (.docx, .doc, .docxm)

Parameters
  • folder – str|PosixPath, default None

  • files – list(str)|list(PosixPath), default None

  • save_to_folder – str|PosixPath, default None

Warning

You can either define folder``or ``files. If files given (more than one), save_to_folder must be defined.

Returns

  • combines docx files and saves in save_to_folder

  • if folder is given but no save_to_folder , output file saved in folder