Can you add small caps in the word JavaScript API to a paragraph

Viewed 288

I'm trying to add text with small caps in the Word API. I read through the paragraph documentation and saw it wasn't implemented using the insertParagraph method. I was hoping to circumvent that by using either insertHtml or insertOoxml.

Right now, my current attempt is to use insertHtml to try to insert the following paragraph

range.insertHtml('text <i>inserted</i> <p style="font-variant: small-caps"> With </p> <b>insert  <p>Html</b> </p> Hello!!!  ', Word.InsertLocation.before);

It seems the office api is stripping that out. I tried changing the font family with the same code and that worked fine.

Does anyone know a work around to this?

1 Answers

For whatever reason this works now. I revisited the project later and the small caps functionality works using the HTML above.

Related