暫無描述

Sample_16_Object.php 511B

123456789101112131415161718
  1. <?php
  2. include_once 'Sample_Header.php';
  3. // New Word document
  4. echo date('H:i:s'), ' Create new PhpWord object', EOL;
  5. $phpWord = new \PhpOffice\PhpWord\PhpWord();
  6. // Begin code
  7. $section = $phpWord->addSection();
  8. $section->addText(htmlspecialchars('You can open this OLE object by double clicking on the icon:'));
  9. $section->addTextBreak(2);
  10. $section->addObject('resources/_sheet.xls');
  11. // Save file
  12. echo write($phpWord, basename(__FILE__, '.php'), $writers);
  13. if (!CLI) {
  14. include_once 'Sample_Footer.php';
  15. }