Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Mar 29, 2021 1:50 pm

Hello,

we are using the following code to suppress blank lines during a mail merge:

Code: Select all
using (var doc = new Spire.Doc.Document())
{
    doc.LoadFromFile(document.OriginalFileLocation);

    doc.MailMerge.HideEmptyGroup = true;
    doc.MailMerge.HideEmptyParagraphs = true;

    doc.MailMerge.Execute(mergeRow.DataRow);

    doc.SaveToFile(tempLocation, Spire.Doc.FileFormat.Auto);
    document.ModifiedFileLocation = tempLocation;
}


This works fine in the document body but doesn't seem to work for a merge field in header/footer.

We use Spire.Office for .NET to version 6.2.1.

profiler007
 
Posts: 72
Joined: Wed Nov 13, 2019 11:32 am

Tue Mar 30, 2021 8:00 am

Hello,

Thanks for your inquiry.
I simulated a Word file and did an initial test, but did not reproduce your issue. To help us look into it further, please provide us with your input file and your output file. You can send them to us(support@e-iceblue.com) via email. Thanks in advance for your assistance.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Tue Mar 30, 2021 6:31 pm

Sorry, my mistake. Works fine.

profiler007
 
Posts: 72
Joined: Wed Nov 13, 2019 11:32 am

Wed Mar 31, 2021 1:34 am

It does not matter.
If you have any other questions related to our products, just feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc