docx
    Preparing search index...

    Function createParagraphStyle

    • Creates a paragraph style reference for a WordprocessingML document.

      The pStyle element specifies the paragraph style to apply to the paragraph.

      Reference: http://officeopenxml.com/WPstyle.php

      <xsd:complexType name="CT_String">
      <xsd:attribute name="val" type="s:ST_String" use="required"/>
      </xsd:complexType>

      Parameters

      • styleId: string

      Returns XmlComponent

      // Using a built-in heading style
      new Paragraph({
      style: HeadingLevel.HEADING_1,
      children: [new TextRun("Chapter 1")],
      });

      // Using a custom style
      new Paragraph({
      style: "MyCustomStyle",
      children: [new TextRun("Styled text")],
      });