require_once 'PHPWord.php';
$PHPWord = new PHPWord();
$SectionStyle1 = array(
'orientation' => null,
'marginLeft' => 900,
'marginRight' => 900,
'marginTop' => 900,
'marginBottom' => 900
);
$Section1 = $PHPWord->createSection($SectionStyle1);
$FontStyle1 = array('color'=>'FF0000', 'size'=>18, 'bold'=>true);
$Section1->addText('Portrait Oriented Section', $FontStyle1);
$Section2 = $PHPWord->createSection();
$SectionStyle2 = $Section2->getSettings();
$SectionStyle2->setLandscape();
$SectionStyle2->setMarginLeft(900);
$SectionStyle2->setMarginRight(900);
$SectionStyle2->setMarginTop(900);
$SectionStyle2->setMarginBottom(900);
$FontStyle2 = array('color'=>'000000', 'size'=>18, 'bold'=>true);
$Section2->addText('Landscape Oriented Section', $FontStyle2);
$Section2->addTextBreak();
$FontStyle3 = array('color'=>'AAAAAA', 'size'=>15);
$Section2->addText('Text 1', $FontStyle3);
$Section2->addTextBreak();
$FontStyle4 = array('color'=>'CCCCCC', 'size'=>13);
$Section2->addText('Text 2', $FontStyle4);
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Text_PHPWord.docx');