Reputation: 341
I am trying to run this code:
const html = '<ul><li>ListItem1</li><li>ListItem2</li><li>ListItem3</li></ul>';
body.insertHtml(html, Word.InsertLocation.end)
to expect:
Somehow, the API doesn't detect the last list item.
Link to live example: ScirptLab
I am trying to render unordered lists in Word programmatically.
Upvotes: 0
Views: 70
Reputation: 49395
You just need to append something to the end, for example, you may append <br>
to the HTML string:
<ul><li>ListItem1</li><li>ListItem2</li><li>ListItem3</li></ul><br>
Upvotes: 2