Quantcast
Channel: PHPWord
Viewing all articles
Browse latest Browse all 450

New Post: Problem w/ Template.docx

$
0
0
Hi every body,

The issue from the template is empty !
What's wrong with may code ?

My code :
<?php
// Include the PHPWord.php, all other classes were loaded by an autoloader
require_once 'PHPWord.php';
require_once 'PHPWord/Template.php';

$PHPWord = new PHPWord();
$template = $PHPWord->loadTemplate('Examples/Template.docx');

$template->setValue('Value1', '101');
$template->setValue('Value2', '102');
$template->setValue('Value3', '103');
$template->setValue('Value4', '104');
$template->setValue('Value5', '105');
$template->setValue('Value6', '106');
$template->setValue('Value7', '107');
$template->setValue('Value8', '1008');
$template->setValue('Value9', '1000');
$template->setValue('Value10', '10067');

$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('../ComperioV1/dossierPerso/Template.docx');
?>
Why that ?

Many thks for your advises !

Viewing all articles
Browse latest Browse all 450

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>