Hello,
I am using Aspose.Word in .NET Core and I am facing a Problem in the MAIL MERGE FIELD as below,
I am using bullet point list and inside the bullet point I am using If condition and foreach loop.
The problem is when I trying to add bullet point it gets added below the foreach loop not at the start of the sentence this is because I have written an loop in the next line and now I want bullet point at the start of line not to foreach loop. For more detail I have attached some Images please go through it. In addition to that If I don’t give the foreach loop onto the new line it either
override the content or print whole sentence multiple times based on the loop content.
@NaikwadiAshish You should use soft line break (Shift+Enter
see ControlChar.LineBreak) instead of paragraph break (Enter
) in your case.
@alexey.noskov I have tried using soft line break but it won’t affect on the output.
The output gets override like this.
@NaikwadiAshish Unfortunately, I cannot reproduce the problem on my side. I have used the following simple code for testing:
Document doc = new Document(@"C:\Temp\in.docx");
doc.MailMerge.UseNonMergeFields = true;
doc.MailMerge.Execute(new string[] { "test" }, new object[] { "my value" });
doc.Save(@"C:\Temp\out.docx");
in.docx (13.6 KB)
out.docx (11.1 KB)
Could you please create a simple template and provide a simple code that will allow us to reproduce the problem? We will check the issue and provide you more information.