createSection(); $section->addText('Check box in section'); $section->addCheckBox('chkBox1', 'Checkbox 1'); $section->addText('Check box in table cell'); $table = $section->addTable(); $table->addRow(); $cell = $table->addCell(); $cell->addCheckBox('chkBox2', 'Checkbox 2'); // Save file $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { echo date('H:i:s'), " Write to {$writer} format", \EOL; $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } include_once 'Sample_Footer.php';