createDocx

createDocx

TRIAL / ADVANCED / PREMIUM

Generates the Word document.

Description
public createDocx ( string $fileName )

It generates a .docx or .docm file depending on how you have called the CreateDocx constructor. The constructor admits an optional parameter: the base template. If omitted the default phpdocx base template is used.

The available options are:

  • 'docx': the default base template is used.
  • 'docm': uses the default Word document with m option is only recommended if you are going to macros with the addMacroFromDoc method.
  • The path to a custom base template.
Parameters

fileName

The path to the resulting Word document.

Return values

DOCXStructure.

Exceptions

License not valid.

Unclosed bookmarks.

Error generating the file.

Code samples

Example #1