Skip to content
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

Possible NumberStyle name, not set in word VBA/doc objects. #404

Open
alpha1125 opened this issue Oct 27, 2014 · 1 comment
Open

Possible NumberStyle name, not set in word VBA/doc objects. #404

alpha1125 opened this issue Oct 27, 2014 · 1 comment

Comments

@alpha1125
Copy link

alpha1125 commented Oct 27, 2014

addNumberingStyle($styleName, $styles)

phpoffice/phpword/samples/Sample_14_ListItem.php

$phpWord->addNumberingStyle(
    'multilevel',
    array('type' => 'multilevel', 'levels' => array(
        array('format' => 'decimal', 'text' => '%1.', 'left' => 360, 'hanging' => 360, 'tabPos' => 360),
        array('format' => 'upperLetter', 'text' => '%2.', 'left' => 720, 'hanging' => 360, 'tabPos' => 720),
    )
    )
);

While the result is opened in word, and watchig the the following path:

ActiveDocument.ListTemplates.Item(1).Name

or any Item(x) is always blank.

The object in word VBA, ActiveDocument.ListTemplates, each element in the items list, has a blank string for the name property. It does not take the styleName, given during creation in PHP.

Mac Word 2011 / VBA code to help debug...

Sub writeAllListTemplateNamesAtTheEndOfTheDocument()

' move cursor to EOD
Selection.EndKey Unit:=wdStory

' write each list template name.
For Each LT In ActiveDocument.ListTemplates
    Selection.TypeText Text:="<name>"
    Selection.TypeText Text:=LT.Name
    Selection.TypeText Text:="</name>"
    Selection.TypeParagraph
Next LT

End Sub

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants