Forum


Replies: 1   Views: 2364
A quick question on createdocxfromtemplate
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by dev@ram  · 11-05-2017 - 20:18

Can we use a macro enabled(.docm) file for CreateDocxFromTemplate API function instead of the normal document (.docx)?

Posted by admin  · 12-05-2017 - 07:25

Hello,

Yes, but you need to remember to rename the DOCX output to DOCM:

$docxTemplate = new CreateDocxFromTemplate('output_macro.docm');

$docxTemplate->addText('New text');
$docxTemplate->createDocx('output.docx');
rename('output.docx', 'output.docm');

Regards.