Forum


Replies: 5   Views: 2591
Issue with addtext(..) in addlist() item
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 04-04-2017 - 06:25

Hello,

In the examples folder included in the package of the license you can find examples of how to use importListStyle, importStyles and parseStyles methods. You can find them in the examples/LayoutAndGeneral folder.

To import a list style you need to use the importListStyle method (https://www.phpdocx.com/api-documentation/layout-and-general/import-list-style-from-a-Word-document-with-PHP). For example:

$docx->importListStyle('template.docx', '1', 'myliststyle');

$itemList = array(
    'Line 1',
    'Line 2',
    'Line 3',
    'Line 4',
    'Line 5'
);

$docx->addList($itemList, 'myliststyle');

If the style is not applied using your custom template, please check that you are setting the correct list ID.

Regards.