Color fonts creating word doc using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
siggo
Forum Newbie
Posts: 1
Joined: Sun Jul 27, 2008 10:58 pm

Color fonts creating word doc using PHP

Post by siggo »

does anyone know how to set the font color when creating a word document using PHP???
I've been looking for days....

$word = new COM("word.application") or die("Unable to instantiate Word");
$word->Documents->Open($template_file);
$word->Selection->Font->Bold = "1";
$word->Selection->Font->Italic = "1";
$word->Selection->Font->Name = "Arial";
$word->Selection->Font->Size = "18";
$word->Selection->TypeText("Your Name:");
$word->Selection->TypeParagraph();
Post Reply