Hidden paragraphs not working in mail merge

I have two hidden paragraphs in my form letter. They depend on one of the fields of my database.

Even if I choose a different record in the database, the hidden paragraphs are not hidden.

My condition to hide the paragraphs states: ![Database.Table.Field]

However, when I display and/or print and say yes to make a form letter and create individual PDF files, they all contain every paragraph.

Is there is an option somewhere that I am missing? I have looked in the all the documentation and there is nothing related to “hidden paragraph”.

Thanks for any help.


NOTE: This was previously reported as: “Hidden Paragraphs are not hidden in mailmerge” but it was closed as not relevant or outdated.

NOTE: I am using version
Test writer file.odt
Test list XLS file.xls

May be your are talking about bug tdf#54703 - but I’m not quite sure, because the bug description started with “hidden sections” and in the course of comments it turns to “hidden paragraphs” as well.

There is another bug report tdf#134728 whose title “Saving into single files inside Mail Merge is ignoring hidden paragraphs” seems to fit your case, but is not set to NEW (hence not confirmed bug).

Is your document a .docx one? To the best of my knowledge, condition syntax does not use square brackets [ and ]. According to the built-in help, you should simply write ! Database.Table.Field.

No @ajlittoz the document is an “.odt” file (i.e. a libre office Writer file).

@ajlittoz I also tried it without the [ and ] surrounding the paragraphs and it still did not work.

How’s your condition entered? With a field associated to a hidden paragraph?

Yes, I have a Database that has some names and addresses (i.e. fields like Street1, Street2, City, State, etc.), however there are some addresses (i.e. Street1) are missing. The name of the Database is “Addresses” and the Table name is “Letters,” therefore my formula is ![Addresses.Letters.Street1] (note that I also tried without the square brackets per comment above). I use this formula at the end of the paragraph(s) to be skipped.

In such way that I should get the following results when there is an address:
John Doe
City, Zip Code State

Dear John…

But I should get the following results when there is no address:
John Doe

Dear John…

Instead what I get when there is no address:
John Doe


Dear John…

Note that it is not eliminating/skipping those paragraphs that are empty based on the fact that Street1 in Table Letters of the Database Addresses is missing.

Edit your question to attach a sample file. Hidden paragraphs are not trivial. It is important to see how you configured your field.

I think this is related to bug 54703 and 134728 as mentioned above.

What is actually happening is that when you create individual files, it’s just making a “copy” of the master document instead of generating the “flattened” versions with the fields filled in and removed. I only see this behaviour when I create the document using a BASIC macro though, not in the front-end.

One thing you could do, to see if it improves things for you exporting to PDF, is go to Tools > Options > LibreOffice Writer > View and checking that “Hidden Paragraph” is NOT checked. This will hide them in the master document and possibly the PDFs you export. If you need to see them again press Ctrl-F9 to hide/show the field codes.

I’m using v7.0.3 (Windows 10) but I am going to test in 6.4.7 to see what happens there.

EDIT: Same behaviour for me on 6.4.7.

I just edit the question and I have added the sample files. The writer file has the “Hidden paragraph” in the “Street 1” and the “City State Zip” lines.

It is necessary to register the list file as a DB, and connect it to the writer file (but you already know that :-))


@FAtristain: works for me, but not in your .odt sample file. This would require to update the “database” name part in all the fields, i.e. replace Addresses by the effective name of the Calc file. I hadn’t the courage to create the correct data source and change all fields.

I used a built-in business letter template where I plugged some of your address book fields + the hidden paragraph field and it worked like a charm.

So my advice is to check for consistency between field designation and spreadsheet file name.

Report back if this is not the correct lead.