Company Move: Need to Know

Hello, I just want to preface this with a huge thank you for reading and
taking any time to reply, sorry for the long post!

My company is looking to move our production team to LibreOffice. We are
currently using Microsoft Office, and using Word 2010 to build all of our
mail merge templates. I have spent about 3 weeks trying to research
workarounds for some of the code we build into our templates to no avail.
And unfortunately there doesn’t seem to be any support online for the issues
I’ve encountered. This is problematic, as we have well over 300 templates
that will need to be broken down and reconfigured if we cannot find
solutions to these issues. Fortunately, we haven’t moved to LibreOffice yet
and production is still functioning. But if I cannot find solutions to these
issues I need to inform my supervisors immediately.

Firstly,

Part of our company has moved completely to LibreOffice and removed
Microsoft Office from their computers. I have tried programming mail merge
templates on my computer, and then having them open it on theirs, and the
documents will not merge. The first error we encountered was that the IF
statements that I built didn’t function at all. I simply wanted to make an
“X” appear when a field contained a certain value. These were if statements
that would function on my computer. The second error was that… well, none of
the merge fields merged. When I re-inserted them they worked fine, but they
wouldn’t pull from the database even after re-registering it. My question
here is, does Word give Libre Writer a leg up if both programs are on one
computer? Is that why when I moved a document I’d programmed and tested to
success in Libre Writer to another computer without Microsoft Office it
wouldn’t function? This is essential to know; because I’m helping others
troubleshoot their issues.

Nested IF Statements:

Is this possible? I have tried a variety of things and I’ve done a good deal
of research, and I’ve hit a wall. We cannot move forward if we do not have
the capability of creating nested if statements.

IF Statements resulting in a Mail Merge Field:

So far I have only been able to make conditional mail merge fields
hide/appear using hidden sections. This is not a practical technique for us,
as our documents are built almost entirely on conditionally revealed values.
I have researched this as much as I could, it seems I cannot create a
conditional statement that results in a mail merge field, but I wanted to
confirm.

Formatting Fields:

We regularly use a formatting switch on our mail merge fields in Word 2010
called “DollarText.” This takes a number from an Excel spreadsheet and
spells it out, like below:

Cell Value: $1,231.67
Formatted: One thousand, two hundred and thirty one dollars and sixty seven
cents.

We have other switches that we need to use as well, but those don’t seem
available in the list of additional formats. Is there a workaround for this,
or am I missing something? I have to admit, I don’t fully understand how to
build custom formats (I haven’t found much documentation on them at all).

Check Boxes:

FormCheckBoxes from Word do not translate in Writer. Meaning, I can open
Word 97-2003 documents containing these functional check boxes with Libre
Writer but they do not print. Is there a setting somewhere that I need to
switch or perhaps a better alternative? I have tried retemplating these
documents in Libre using Writer’s FormCheckBoxes but they are impossible for
me to place on a table. Wingdings are also not an option.

Table-Intensive Documents:

We build forms that go to court, so they have to be laid out in tables
exactly as the court requires. Most of the time we build these forms on
tables in Word. When opened in Libre Writer, the tables break, cells expand,
and other such things occur. I spent 4 hours last week trying to rebuild one
for a firm that doesn’t have access to Microsoft Office and had no luck.
After I finally finished my rebuilding, I saved the document as a Writer
document to prevent further issue with compatibility, and to my absolute
dismay I discovered that it turned all of the mail merge fields into text. I
spent the next 4 hours attempting to reprogram it. …I don’t really have a
question here, I guess.

Crashes:

We have already built hundreds of mail merge templates in Word. In order to
continue to function through the conversion from Word to Writer, we need to
be able to merge these and not rebuild them all immediately. However,
simple, very simple, documents have been crashing Writer like we were in a
derby and on fire. This isn’t just with one, but a great majority of our
templates. Is this common? They are Word 97-2003 documents I am opening in
Libre Writer 4.0.

In all, I just need to know if these things are possible. If not, I can tell
my team that we need to keep Microsoft Office, the rest of our company is on
Libre anyway. If they are, I would love a brief tutorial or explanation.

Also, below are some fun, plain-text formulas I built in Word that we use on
every day templates, just to give you an idea of the level of complexity I’m
talking about.

{ IF “{ IF {MERGEFIELD COUNTY } = “MIAMI=DADE” “MIAMI-DADE” }” <> “” “ { IF
“{ IF { MERGEFIELD SUITCOST } >= 5001.00 “GREATER” “” }” = “” “CHECKS” “NO
CHECKS” }” “{ IF “{IF {MERGEFIELD COUNTY } = “BAKER” “CHECKS” }{IF
{MERGEFIELD COUNTY } = “CLAY” “CHECKS” }{IF {MERGEFIELD COUNTY } =
“COLUMBIA” “CHECKS” }{IF {MERGEFIELD COUNTY } = “DESOTO” “CHECKS” }{IF
{MERGEFIELD COUNTY } = “DIXIE” “CHECKS” }{IF {MERGEFIELD COUNTY } = “GLADES”
“CHECKS” }{IF {MERGEFIELD COUNTY } = “HOLMES” “CHECKS” }{IF {MERGEFIELD
COUNTY } = “INDIAN RIVER” “CHECKS” }” = “” “NO CHECKS” “CHECKS” }” }

The above formula determines firstly whether or not the county we’re filing
in is Miami-Dade or not. If it is, it then goes and determines whether or
not the principal we’re filing for is over $5001.00. If it is, we want
checks, otherwise it will say “NO CHECKS.” If it is not Miami-Dade it checks
to see whether the county is any within a list of counties and if it is, it
will result in “CHECKS” which triggers the final layer of IF statements to
either display “CHECKS” if it is one of those counties or “NO CHECKS” if it
is not.

Basically…

ARE THE PARENTHESIS EMPTY?
(COUNTY = MIAMI-DADE?
True: SUITCOST = 5001.00 False: No Checks
True: Checks False: No Checks

False: COUNTY = “List of Counties”
True: Checks False: BLANK)
YES: No Checks NO: Checks

{ SEQ NUM \r { IF { MERGEFIELD NUMBER4 } <> “” “77” “{ IF { MERGEFIELD
NUMBER3 } <> “” “60” “{ IF { MERGEFIELD NUMBER2 } <> “” “43” “20” }” } }

This is how we number paragraphs in our documents. Because we make frequent
edits, and the “automated numbering” tool in Word continues numbering
through all the documents in the merge, we have to program numbers in. These
can change depending on which paragraphs we include, and we have to force
the field to start at certain numbers depending on certain variables.
The \r switch within the field tells the field it needs to start at a
specified number. In this case, if “NUMBER4” in our spreadsheet isn’t blank,
we want the IF statement to result in “77.” If it is blank and “NUMBER3” is
not, we want it to result in 60 and thus start numbering at 60. And so on…

Can these be recreated in Libre Writer without learning to code in Pearl and
C++?

Hi :slight_smile:
A couple of key points.

Firstly ...
So far you seem to have been following the Microsoft route to change.
"Slash and burn" or "burning your bridges". It is better to think of
"migration" rather than "move to".

Step 1 is to install LIbreOffice alongside MS Office

Step 2 is to start gradually using LibreOffice more and more. Certain
people might be resistant at first. Certain tasks might still require
MSO for a while. During this phase companies seem to still buy
machines with MSO on or even install and upgrade MSO on some machines.
Some retraining of some staff might be required. Perhaps pick key
people from each department. Best seems to be
1. people who are still using MS Office 2003 or who were very
familiar with it and hate the ribbon-bar,
2. geeks and innovators
3. people who seem to help colleagues naturally or who people go to
for help with IT issues
This reduces the down-time and usual confusion when moving to new systems.

Step 3 is to start rolling out training more widely. Around now stop
buying new MSO licenses but still keep old versions of MSO. This is
the phase to stop getting MSO on newer machines. Keep working at
setting-up LibreOffice to do those awkward tasks that still need MSO.

It's only with MS products that you need to get rid of the old
systems. The usual reasons are incompatiblities with formats,
difficulty to support, security issues and so on. With OpenSource
it's a complete contrast. You can keep the older systems even though
they are almost never used. Incompatibilities fade and security and
support issues drop away. New staff might start off using MSO but
quickly find that LO is better so they gradually learn from colleagues
without "being all at sea" so much in their first few days.

So a lot of OpenSource advocates would recommend never bothering to
remove MS products at all. Just minimise their usage.

Secondly ...
It helps to get advice from people who have helped many companies
migrate. My steps are just a rough-outline but they can help develop
more precision tailored to your company from where you have got to so
far. They might also be able to help with certain specifics and may
have tools developed by other companies, governments or organisations.
The people on our "Contacts" page can probably help guide you to a
suitable organisation or individual to help with that.

Regards from
Tom :slight_smile:

Hi Sqwuiddy,

I think you'd be best hiring someone in for a few days to help you
with this. There are several questions that need answers to help
further.

In general you should be ok on many of these things, I'm not certain
about all of them.

Nested IF statements do work.

Where is the data that you're merging? How are you accessing it? It
sounds like you know what you're doing with data in general, so it
might just be an LO-related issue. Incorrectly accessing that data
often results in "not merging". When you say "none of the merge fields
merged", what, precisely, happened?

Sorry, I don't have time for more.

Regards
Mark

First, you should know that you want to work only with the .odt format. .doc isn't going to work.

Second, AFAIK, you have to reinsert any fields. I have no idea why. With 300 templates, that's a bit of a chore. However one bit of knowledge might make it slightly easier for you. Here's a copy of a post I made recently:

Whoa !! Too many questions in one post.

Part of our company has moved completely to LibreOffice and removed
Microsoft Office from their computers. I have tried programming mail merge
templates on my computer, and then having them open it on theirs, and the

I hope that the migrated templates are in ODF format (ott), or else you
are heading for trouble...

documents will not merge. The first error we encountered was that the IF
statements that I built didn’t function at all. I simply wanted to make an
“X” appear when a field contained a certain value. These were if statements
that would function on my computer. The second error was that… well, none of

IF statements should work, at least within ODF documents, as far as I know.

the merge fields merged. When I re-inserted them they worked fine, but they
wouldn’t pull from the database even after re-registering it. My question
here is, does Word give Libre Writer a leg up if both programs are on one
computer? Is that why when I moved a document I’d programmed and tested to

No, Word does not help Writer in any way here to my knowledge. More
likely it comes down to the fact that your template when transferred
must contain the same paths to the data source (which you don't mention
in detail). From the rest of your post, it appears that you are merging
from an Excel sheet ? For the mailmerge to work reproducibly, your ODF
document must reference the Excel sheet as a datasource in the same way
as on your own machine, and if the datasource is registered with LO, it
is written into the user configuration.

Nested IF Statements:

Is this possible? I have tried a variety of things and I’ve done a good deal
of research, and I’ve hit a wall. We cannot move forward if we do not have

No idea, as I've never tried this.

IF Statements resulting in a Mail Merge Field:

So far I have only been able to make conditional mail merge fields
hide/appear using hidden sections. This is not a practical technique for us,
as our documents are built almost entirely on conditionally revealed values.
I have researched this as much as I could, it seems I cannot create a
conditional statement that results in a mail merge field, but I wanted to
confirm.

My understanding was that hidden sections was the route to choose in
order to obtain what you want. It might be possible to obtain something
similar via User variables, which are stored in the document, but the
number of these that you can define are limited (4 or 6 or something so
small as to be practically useless ?).

There are other techniques available that do not rely on the UI to do
this, including setting variables within the document as any given
character, and then using a scripting framework to control replacement
of those variables with the values you want and have a user driven
interface, but most of these are command line solutions (Python, Java,
Rexx, etc)

Formatting Fields:

We regularly use a formatting switch on our mail merge fields in Word 2010
called “DollarText.” This takes a number from an Excel spreadsheet and
spells it out, like below:

Cell Value: $1,231.67
Formatted: One thousand, two hundred and thirty one dollars and sixty seven
cents.

We have other switches that we need to use as well, but those don’t seem
available in the list of additional formats. Is there a workaround for this,
or am I missing something? I have to admit, I don’t fully understand how to
build custom formats (I haven’t found much documentation on them at all).

You would probably require a macro to convert a number to spelled-out
text, there used to be one around in the shape of an extension that
could do this, but I haven't checked recently. As for user defined
formats, these tend to be limited to fairly simple string formats,
otherwise you're going to have to devise a macro to do it for you.

Check Boxes:

FormCheckBoxes from Word do not translate in Writer. Meaning, I can open
Word 97-2003 documents containing these functional check boxes with Libre
Writer but they do not print. Is there a setting somewhere that I need to
switch or perhaps a better alternative? I have tried retemplating these
documents in Libre using Writer’s FormCheckBoxes but they are impossible for
me to place on a table. Wingdings are also not an option.

Non-printing of Word checkboxes is/was a known bug. Don't know if that
has been fixed, or if a fix is even in the works. I have always found
that using Writer checkbox controls is fraught with dissatisfaction
because they are too small, do not scale well, and do not allow you to
choose the tick mark character.

Table-Intensive Documents:

We build forms that go to court, so they have to be laid out in tables
exactly as the court requires. Most of the time we build these forms on
tables in Word. When opened in Libre Writer, the tables break, cells expand,
and other such things occur. I spent 4 hours last week trying to rebuild one

Tables and nested table import from Word are still problematic, due to
incomplete (or buggy) filter implementation and differences in the specs
of each product which define how tables should be handled.

for a firm that doesn’t have access to Microsoft Office and had no luck.
After I finally finished my rebuilding, I saved the document as a Writer
document to prevent further issue with compatibility, and to my absolute
dismay I discovered that it turned all of the mail merge fields into text. I

You seem to be expecting perfect transition from a heavily MS-Office
centric document usage to LibreOffice without having to reconsider how
the various objects in these documents are managed by the corresponding
software - as you have found out, this simply doesn't happen.

We have already built hundreds of mail merge templates in Word. In order to
continue to function through the conversion from Word to Writer, we need to
be able to merge these and not rebuild them all immediately. However,
simple, very simple, documents have been crashing Writer like we were in a
derby and on fire. This isn’t just with one, but a great majority of our
templates. Is this common? They are Word 97-2003 documents I am opening in
Libre Writer 4.0.

I would recommend switching to a more recent version of LibreOffice than
4.0, which was decidedly buggy (not that there aren't any with 4.1.5.x
or 4.2.x.x, but the doc and docx filters have been improved since 4.0).
Note that Word 2003 format was an incomplete transitional OOXML for
which it is very hard to provide adequate import/export filters, because
it supported both old and new MS specific document objects, and even
then did so incompletely. You should not expect MS 2003 xml formats to
be imported correctly. You might fare better with Word 97 only formats
when importing, but even these (see table problems) will not be perfect.

Also, below are some fun, plain-text formulas I built in Word that we use on
every day templates, just to give you an idea of the level of complexity I’m
talking about.

Can these be recreated in Libre Writer without learning to code in Pearl and
C++?

Frankly, they could be coded in LO Basic, and yes, that means, having to
learn it - its structure and objects are not the same as MS VBA.

Alex

Hi :slight_smile:
This is part of the reason for keeping existing versions of MS Office
during the migration period.

Existing templates and documents hopefully work well on existing
versions of MS Office. They don't always work so well on newer
versions of MS Office but upgrading the templates is then considered
part of the cost of the upgrade.

MS Office 2007 uses a "transitional" OOXML format. MS Office 2010
uses a different one. MS Office 2013 uses yet another by default but
allow "strict" OOXML through the
File - "Save As ..."
menu. There was some attempt to 'backport' the OOXML format to 2003
and earlier but i'm not sure which of the "transitional" formats was
used or if it was yet another version.

Mostly MS Office 2003 and earlier use a previous MS format that had
finally become fully interoperable with many other programs, suites
and usable cross-platform but MS chose that moment to start using
OOXML which promised (but apparently failed to deliver) the promise of
interoperability that the older format had just achieved. The new
OOXML format kinda forces everyone to keep buying their newer and
newer versions of MS Office. MS Office is one of the biggest income
streams for the profit making company.

By contrast LibreOffice, OpenOffice, Caligra/KOffice, IBM Lotus
Symphony and many other programs all use ODF and can easily be set to
default to the ISO standard that works exactly the same in all
versions of all programs, except MS Office.

So, sticking with MS formats and MS programs ensures needing to
upgrade all the templates every 3 years or so. Moving to LibreOffice
means upgrading to the ODF formats and templates this one time.

The additional advantage with migrating to LibreOffice (or OpenOffice)
is that it is possible to do so without losing your existing version
of MS Office. MS Office doesn't really allow that as an option.
Well, it does but it's difficult to do and leads to confusions and
problems. I've done it but it's really not worth the hassle.

So, keeping existing MS Office for existing templates and documents is
smart. New templates and documents need to start being made on
LibreOffice but you can still use the old ones on MS Office. Plus it
gives you more time to upgrade existing templates and test they work
before becoming dependant on them.

Regards from
Tom :slight_smile: