Use built-in or custom table styles just as easily as using a paragraph style for text. Include text formatting, borders, shading, cell sizing, or any table formatting you need.įigure 9. Insert built-in or custom drawing shapes, with or without text and formatting effects. Text effects are available in Word for text inside a text box (as shown here) or for regular body text. Use content controls with your add-in to add content at a specified (bound) location rather than at the selection.įigure 6. An image formatted using picture styles and effectsĪdding high quality formatting and effects to your images requires much less markup than you might expect. Use the same method for inserting any Office-supported image format.įigure 4. Use a style to automatically coordinate the look of text you insert with the user's document. Use direct formatting to specify exactly what the text will look like regardless of existing formatting in the user's document. Throughout this article, the terms content types and rich content refer to the types of rich content you can insert into a Word document. Determining the Office Open XML markup you need to get it done is easier than you might think. dotx) are written, you can insert virtually any type of content that a user can add to a Word document, with virtually any type of formatting the user can apply. Depending on your scenario, there can be drawbacks to HTML coercion, such as limitations in the formatting and positioning options available to your content.īecause Office Open XML is the language in which Word documents (such as. If APIs aren't yet available, you can use HTML for inserting some types of rich content, such as pictures.
#Microsoft word plugins for writers code#
For an example, see the Insert formatted text code snippet in Script lab on Word. So what are your options when you need to add rich content to a document, such as images, formatted tables, charts, or even just formatted text? Start with the APIs available through the WordApi requirement sets to see if they provide what you need. These are called coercion types, and they include plain text, tables, HTML, and Office Open XML. If you're building Office Add-ins to run in Word, you might already know that the Office JavaScript API (Office.js) offers several formats for reading and writing document content. Provided by: Stephanie Krieger, Microsoft Corporation | Juan Balmori Labra, Microsoft Corporation