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.

Sun Sep 25, 2016 1:47 pm

Hello, we bought the Spire.Doc and have a problem with MailMerging HideEmptyParagraphs flag.

I've detected that it doesn't work in some cases (please check attachment)
As an example I show you 2 cases when HideEmptyParagraphs doesn't work:
1. when IF field is added to the line
2. when <space> is added directly between MERGEFIELDs

so in a case SMIDDLENAM and SFAMILYNAM are empty I expect
Code: Select all
HideEmptyParagraphs = true

must remove such empty lines

But it doesn't work. 2 empty lines are present in merged doc.

Both cases work correct via interop Word lib.

Could you please fix it?

_andrews_
 
Posts: 10
Joined: Sun Apr 03, 2016 11:20 am

Mon Sep 26, 2016 9:22 am

Hi,

Thanks for your inquiry.
We will look into it further and then update to you. Sorry for inconvenience.
Also, we didn't find the purchaseinformation about your email address, could you please give us your order information so that we can make a record and then provide you support ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Sep 26, 2016 3:31 pm


_andrews_
 
Posts: 10
Joined: Sun Apr 03, 2016 11:20 am

Tue Sep 27, 2016 3:14 am

Hi,

Thanks for your information.
For issue#1, there are SMIDDLENAM field and IF field in one paragraph, the empty SMIDDLENAM field can be hidden, but the IF field still exsits, so there will be a line.
For issue#2, I have noticed that there will be one empty line, and posted it to our Dev team. We will inform you once there is any progress. Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Sep 27, 2016 4:04 am

Hi,

By investigation, for issue#2, sorry that I am afraid the paragraph can not been hidden, as the <space> is added in the paragraph, it will have data in paragraph, it is not empty paragraph in fact. So there will be one line. Sorry for inconvenience.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Oct 03, 2016 5:27 pm

Is it possible to check <IF> field Value, and in a case if Value = <empty> then remove <IF> field at all from the document?
Could you please show a code sample for removing Field from a document?

_andrews_
 
Posts: 10
Joined: Sun Apr 03, 2016 11:20 am

Wed Oct 05, 2016 9:24 am

Hello,

Here is the codes to remove field for your reference.
Code: Select all
 for (int i = 0; i < para.ChildObjects.Count; i++)
                    {
                        DocumentObject doj = para.ChildObjects[i];
                        if (doj is Field)
                        {
                            Field Field = doj as Field;
                            if (Field.Type == FieldType.FieldIf)
                            {
                                fieldStartIndex = para.ChildObjects.IndexOf(doj);
                                para.ChildObjects.RemoveAt(fieldStartIndex);
                            }
                        }
                    }

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Sun Oct 09, 2016 7:59 am

Dear _andrews_,

Did you test the code provided by Gary ? Has your issue been resolved ?
Could you please give us some feedback at your convenience ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc

cron