MailMerge Formatting is not supporting with in Repeatblocks

«TableStart:AgentRebate»

«SOURCE»

«TableEnd:AgentRebate»

Here i need to print like (if the source=test)

TEST

Hi Piers,

Thanks for your inquiry. In your case, you need to format your mail merge field with upper as shown below.

{ MERGEFIELD SOURCE * Upper * MERGEFORMAT }

If you still face problem, please share following detail for investigation purposes.


  • Please attach your input Word document.
  • Please

    create a standalone/runnable simple application (for example a Console
    Application Project
    ) that demonstrates the code (Aspose.Words code) you used to generate
    your output document

  • Please attach the output Word file that shows the undesired behavior.
  • Please
    attach your target Word document showing the desired behavior. You can
    use Microsoft Word to create your target Word document. I will
    investigate as to how you are expecting your final document be generated
    like.

As soon as you get these pieces of information to
us we’ll start our investigation into your issue.

HI Tahir.manzoor

I have already created like this MERGEFIELD Source * Upper * MERGEFORMAT

i have uploaded my test template can you please see this once

Thanks

Suresh@valuepro.com.au

Hi Piers,

Thanks for sharing the detail. Perhaps, you are using an older version of Aspose.Words; as with Aspose.Words v14.6.0, I am unable to reproduce this problem on my side.

I would suggest you please upgrade to the latest version of Aspose.Words i.e. v14.6.0 and let us know how it goes on your side. I hope, this will help. I have used the following code example to test this issue and have attached the output document with this post for your kind reference.

Document doc = new Document(MyDir + "test142.docx");

DataTable dt = new DataTable("AgentRebate");

dt.Columns.Add("Source", typeof(string));

dt.Rows.Add("Test Data");

doc.MailMerge.ExecuteWithRegions(dt);

doc.MailMerge.Execute(new string[] { "Staff.Name" }, new string[] { "Some text" });

doc.Save(MyDir + "Out.docx");