PHPWord/samples/Sample_16_Object.php

19 lines
493 B
PHP
Raw Normal View History

<?php
2014-03-15 22:39:57 +07:00
include_once 'Sample_Header.php';
// New Word document
2015-01-01 20:41:42 +04:00
echo date('H:i:s'), ' Create new PhpWord object', EOL;
$phpWord = new \PhpOffice\PhpWord\PhpWord();
// Begin code
$section = $phpWord->addSection();
2016-06-04 20:06:37 +04:00
$section->addText('You can open this OLE object by double clicking on the icon:');
$section->addTextBreak(2);
$section->addObject('resources/_sheet.xls');
// Save file
2014-04-12 10:12:24 +07:00
echo write($phpWord, basename(__FILE__, '.php'), $writers);
if (!CLI) {
include_once 'Sample_Footer.php';
}