importListStyle

importListStyle

TRIAL / ADVANCED / PREMIUM

Imports an existing list style from an external Word document.

Description
public importListStyle ( string $path, int $id, string $name)

This method allows to import a list style from an external Word document.

Parameters

path

The path to the Word document from which we want to import the list style.

id

The id of the style to be imported. The id may be obtained with the help of the parseStyle method.

name

New style name.

Exceptions

List style can't be found.

Code samples

Example #1

The resulting Word document looks like:

Release notes
  • phpdocx 12.0:
    • supported linked numbering styles.
  • phpdocx 10.0:
    • in-memory DOCX documents.
  • phpdocx 9.5:
    • improved importing multiple styles and sources.
  • phpdocx 6.0:
    • new method.