Create Word Document with Table Of Contents TOC field & Preserve Bullet Numbering Style using C# .NET Core

Hi,
I am using Aspose (Aspose.Word) to create word document (having Table Of Content) using .Net Core. Though word document is created successfully but the issue is somewhere in the created document some bullets points are converting into numbers automatically.It is not coming as bullet points.
Please let me know how to resolve this issue.

Looking forward to hear from you.

Thanks

@prakhar6355,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • Aspose.Words generated output DOCX file showing the undesired behavior
  • Please also create a standalone simple Console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

As soon as you get these pieces of information ready, we will start investigation into your scenario and provide you more information. Thanks for your cooperation.

Hi Hafeez,

Sorry for late reply !

Thankyou so much for the above response . Luckily it got fixed from my end. So thankyou ! :slight_smile:
Though i have one more small issue which i am facing in .Net. (Aspose word)
Issue:
I need to set date in footer which is basically coming from database. But from below code i can see only today’s date is getting updated in footer rather than the date from database. Please let me know how i can update the date of my choice.

      -- builder.Write("Published Date: ");
      -- builder.InsertField("Date", "Database_DATE");

Please share me the code if possible. Looking forward to hear from you soon.

Thankyou.

@prakhar6355,

Specifying Date field in InsertField method will insert Today’s Date in Word document. Instead, you can populate a DateTime object against the value coming from Database and then insert DateTime object as string in Word document.

Document doc = new Document("E:\\Temp\\input.docx");
DocumentBuilder builder = new DocumentBuilder(doc);

DateTime dateTime = DateTime.Now.AddYears(-10);

builder.MoveToDocumentEnd();
builder.Write(dateTime.ToString("dd/MMM/yyyy"));

doc.Save("E:\\Temp\\20.6.docx");