How do I get SubScript / SuperScript to work?

Nov 3, 2011 at 10:36 PM

Hi,

I'm using the following snippets of code, but can't get the text ("ST") to appear as superscript.  I also tried subscript (didn't work).  I added bold, which works.

$PHPWord->addParagraphStyle('pRight',array('align'=>'right','spaceBefore'=>0,'spaceAfter'=>0,'spacing'=>0));

$textrun = $section->createTextRun('pRight');
$textrun->addText("January 01", null);
$textrun->addText("ST", array('superScript'=>true, 'bold'=>true));
$textrun->addText(", 2011", null);

Can anyone advise what I'm doing wrong?

Thanks!