Hi,
Im using Aspose.Words v. 16.11.0.0
I have 6 mergefield of which 3 of them are blanks (empty string)
As far as i can read, if I use the following setting:
doc.MailMerge.CleanupOptions = MailMerging.MailMergeCleanupOptions.RemoveEmptyParagraphs
It is supposed to remove the mergefield + row entirely and thereby not insering a blank row.
But the blank row is still there - how can I remove it?
I have tried to use all the settings in the CleanupOptions, but nothing is working for me.
Im using the following code, and have attached the document I use:
Dim doc As New Aspose.Words.Document("C:\Test\KollektivTest.docx")
Dim fieldnames As New List(Of String)
Dim values As New List(Of String)()
fieldnames.Add("Adresse_Navn")
values.Add("Test")
fieldnames.Add("Adresse_Navn2")
values.Add("")
fieldnames.Add("Adresse_CO")
values.Add("")
fieldnames.Add("Adresse_Adresse")
values.Add("Test2")
fieldnames.Add("Adresse_Lokalby")
values.Add("")
fieldnames.Add("Adresse_Postby")
values.Add("Test3")
doc.MailMerge.CleanupOptions = MailMerging.MailMergeCleanupOptions.RemoveEmptyParagraphs
doc.MailMerge.Execute(fieldnames.ToArray(), values.ToArray())
doc.Save("C:\Test\Lala_" + Guid.NewGuid().ToString() + ".pdf", SaveFormat.Pdf)