-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to add styleref #1349
Comments
maybe you can try with a PreserveText (https://phpword.readthedocs.io/en/latest/elements.html#preserve-texts) $header->addPreserveText('{ STYLEREF "Heading 1" \* MERGEFORMAT }'); |
Thanks .. it works 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to add styleref i tried
$header->addField('StyleRef', array('stylename' => 'Heading 1'), null, $text)
but it show this error
Uncaught exception 'InvalidArgumentException' with message 'Invalid type 'StyleRef''
then i added in field.php
at the $fieldsArray :
'StyleRef' => array(
'properties' => array( 'stylename'=> array('Heading 1')),
'options' => array('PreserveFormat'),
),
it didn't show error but it shows "Error! No style name given." in generated word docx
The text was updated successfully, but these errors were encountered: