importStylesWordDefault

importStylesWordDefault

TRIAL / ADVANCED / PREMIUM

Imports MS Word default styles.

Description
public importStylesWordDefault ( [string $type = 'ignore', array $styles = array()] )

This method imports MS Word default style names to the document.

Parameters

type

The available options are:

  • 'ignore': ignore styles with the same name.
  • 'replace': overwrite styles with the same name.

styles

Styles to be imported. All as default.

The available styles are:

  • 'DefaultParagraphFont' : character style.
  • 'CommentReference', 'CommentText', 'CommentTextChar' : comment styles.
  • 'EndnoteReference', 'EndnoteText', 'EndnoteTextChar' : endnote styles.
  • 'FootnoteReference', 'FootnoteText', 'FootnoteTextChar' : footnote styles.
  • 'Heading1', 'Heading2', 'Heading3', 'Heading4', 'Heading5', 'Heading6', 'Heading1Char', 'Heading2Char', 'Heading3Char', 'Heading4Char', 'Heading5Char', 'Heading6Char' : heading styles.
  • 'Hyperlink' : hyperlink style.
  • 'NoList' : numbering style.
  • 'NoSpacing' : paragraph style.
  • 'TableGrid', 'TableNormal' : table style.
  • 'Title', 'TitleChar', 'Subtitle', 'SubtitleChar' : title styles.
Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like:

Release notes
  • phpdocx 15.0:
    • new method.