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

how to make list item numbers bold #260

Open
londonwallops opened this issue Dec 10, 2024 · 8 comments
Open

how to make list item numbers bold #260

londonwallops opened this issue Dec 10, 2024 · 8 comments

Comments

@londonwallops
Copy link

var s1l2p1 = masterList.AddItem("Performance", 1).SetBold(true);

This code is giving the following output:

"1.2 Performance"

But I want to make the 1.2 bold as well. How do I achieve this?

@PrzemyslawKlys
Copy link
Member

You can see this:

@londonwallops
Copy link
Author

WordList wordList2 = document.AddList(WordListStyle.Headings111, false, 12);

When I use this code to change the sizing I just get the error CS15101: No overload for method "AddList" takes 3 arguments. It appears it only takes one argument, which is the wordliststyle value?

@PrzemyslawKlys
Copy link
Member

I guess it was never implemented... it was working as part of that PR, but never made to master.

@londonwallops
Copy link
Author

ok that's great! this means that we can just push this to Master and it will add this functionality right?

@PrzemyslawKlys
Copy link
Member

yes and no, it was missing any tests so it was stale. Also if you look at XML level how Word does the changes it does it in different place, and there was question in for that as well, again - a reason why it was stale. And now PR owner deleted it... so we're starting from scratch. Also his PR only addressed the size of the style, not everything so there's more to it...

@londonwallops
Copy link
Author

Yes I would like to be able to make it bold. In Fact I only really need it to be bold and I'm not really bothered about the font size. Are you working on this/is there any way I could help this development. I am motivated to not have to rewrite my project in OpenXML haha.

@PrzemyslawKlys
Copy link
Member

If look at OpenXMLSDK, the changes as shown here:

image

Are done on the "numbering" side

image

On the very first level, and the PR that was proposed was doing it similarly but for all levels, it was also not complete as it allowed to set it, but not really to manipulate it, or even check if it's set.

It shouldn't be too hard to implement but I've been busy with other stuff. WordList class mostly has everything ready to add this.

@PrzemyslawKlys
Copy link
Member

As part of this PR:

I've added basic properties, you can play with it in that branch

                var paragraph = document.AddParagraph("This is 1st list - LowerLetterWithBracket");
                paragraph.ParagraphAlignment = JustificationValues.Center;

                WordList wordList1 = document.AddList(WordListStyle.LowerLetterWithBracket);
                wordList1.Bold = true;
                wordList1.FontSize = 16;
                wordList1.Color = Color.DarkRed;

                var listItem1 = wordList1.AddItem("Text 1");
                listItem1.Bold = true;
                listItem1.FontSize = 16;
                listItem1.Color = Color.DarkRed;

                wordList1.AddItem("Text 2", 1);
                wordList1.AddItem("Text 3", 2);

                paragraph = document.AddParagraph("This is 2nd list - LowerLetterWithDot");
                paragraph.ParagraphAlignment = JustificationValues.Center;
                paragraph.Bold = true;
                paragraph.FontSize = 16;
                paragraph.Color = Color.AliceBlue;

                document.Save(openWord);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants