Forum


Replies: 3   Views: 174
Using getwordstyles with a type
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 jeremie  · 16-07-2024 - 15:01

getWordStyles only works with type "default".

The following code works well and returns a list of styles:

$docx = new CreateDocxFromTemplate($document_word);
$referenceNode = array(
         'type' => 'default',
);
$styles = $docx->getWordStyles($referenceNode);

But any other $referenceNode returns an empty $styles for instance:

$referenceNode = array( 'type' => '*' );
$referenceNode = array( 'type' => 'paragraph' );
$referenceNode = array( 'type' => 'paragraph', 'contains' => 'Hello world' );

It used to work properly with version 9. I'm using version 12 and it doesn't work anymore.

What am I missing?