DocX icon indicating copy to clipboard operation
DocX copied to clipboard

Bulleted List Still Appears As Numbered

Open cbitting opened this issue 7 years ago • 5 comments

When creating a list using the type: Xceed.Words.NET.ListItemType.Bulleted, the end result still appears as numbered. I've tried specifying this at the .AddList and the .AddListItem method the result is still numbered.

List bulletedList = document.AddList("test", 0, Xceed.Words.NET.ListItemType.Bulleted,0,false,false); document.AddListItem(bulletedList, "test2",0,Xceed.Words.NET.ListItemType.Bulleted, 0, false, false);

Maybe I'm doing something wrong?

cbitting avatar Jan 24 '18 13:01 cbitting

Hi,

After trying in v1.1, I get bulleted lists. Here's the code I used : var doc = DocX.Create( "Output.docx" ); var bulletedList = doc.AddList( "test", 0, Xceed.Words.NET.ListItemType.Bulleted, 0, false, false ); doc.AddListItem( bulletedList, "test2", 0, Xceed.Words.NET.ListItemType.Bulleted, 0, false, false ); doc.InsertList( bulletedList );

  var bulletedList2 = doc.AddList( "test3", 0, Xceed.Words.NET.ListItemType.Bulleted, 0, false, false );
  doc.AddListItem( bulletedList2, "test4", 0, Xceed.Words.NET.ListItemType.Bulleted, 0, false, false );
  doc.InsertList( bulletedList2 );

  doc.Save();

XceedBoucherS avatar Feb 23 '18 12:02 XceedBoucherS

After trying in v1.1, I get bulleted lists. Here's the code I used : var doc = DocX.Create( "Output.docx" ); var bulletedList = doc.AddList( "test", 0, Xceed.Words.NET.ListItemType.Bulleted, 0, false, false ); doc.AddListItem( bulletedList, "test2", 0, Xceed.Words.NET.ListItemType.Bulleted, 0, false, false ); doc.InsertList( bulletedList );

This code does not work when a template is applied to the document, the list always becomes numbered.

ghost avatar May 08 '19 14:05 ghost

What is the template. Can you show the template and code you are using ? Thank you

XceedBoucherS avatar Oct 01 '19 11:10 XceedBoucherS

I have no longer access to the template, but I solved it changing the constructor to:

doc.AddList(listType: ListItemType.Bulleted);

ghost avatar Oct 30 '19 21:10 ghost

Hello. I recognize this is an old issue, but I wanted to provide some additional information since I encountered the same behavior on an outdated version of the package.

I could replicate this behavior on DocX 1.3. Specifically, when using a template, a bulleted list still appeared as numeric. I used the template for the task then switched to a completely fresh newly create word document to verify that the template being used wasn't affecting behavior. Both a user manipulated template and a blank word document template had persistent numberings despite being set to bulleted in the code.

When creating a new document using DocX (DocX.Create()), the list did appear as bulleted as mentioned by XceedBoucherS.

I have not tested on the latest version of DocX available 1.8.

katldewitt avatar Oct 31 '21 16:10 katldewitt