PDA

View Full Version : What's the limit of complexity for a mail merge before the previews start to fail?



Agent Smith
06-07-2019, 10:54 AM
What's the limit of complexity for a mail marge before the previews start to fail and can it be fixed?

I have found with a document i'm working on that when i add too many fields or more complicated fields the previews start to fail to update fields properly.

Is this something that can be fixed? Would 64 bit version of office help?

gmayor
06-07-2019, 08:07 PM
The preview is only a guide. You need to complete the merge to an new document to see the actual result.
The number of merge fields you can use depends on the data source. For Excel it would be 256.
If you need more than that you would need to use a CSV format data source.

Agent Smith
06-08-2019, 01:27 AM
By that do you mean 256 individual fields or would 1 field but repeated many times in document cause issues. I'll have to count but don't think I have anywhere near 256 fields (I probably have around 25) but I do have lots of "IF" statements many of which are nested. The document I'm working on is about 13 years old and has evolved over time. I produced it long before I got to grips with VBA and learned about SQL. I tend to have a little play with it every couple of years to tweak it. As you have guessed I have not been finalizing it and just been clicking through the preview and printing as I go along. I hit the issue with the preview not updating properly a few years ago when I tried to make it a bit more complex. I forgot about this until I just applied my update. For this update I have just added 3 extra fields, which are the markers where the pictures are inserted. Now when I click through the preview the recipient doesn't always change properly and for some reason one particular record keeps getting repeated. It seems that some other data update correctly though. When I finalize the merge they are all correct.

It may be time to start from scratch give my knowledge of vba and sql that I didn't have when I first produced it.

The csv option sounds interesting. So could I make access produce a csv file instead of a query and then get word to use this? That would acctually work better as currently my database is passworded so I have to copy the table and query to a new database manually which word can then access.

macropod
06-08-2019, 03:26 AM
The 256 refers to the number of fields in the data source (e.g. 256 columns in Excel). Word IF fields can be nested up to 20 levels. Without knowing what you're actually trying to do or seeing your mailmerge main document, though, it's impossible to say how things might be improved. You can attach a document to a post via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.

Agent Smith
06-08-2019, 08:48 AM
I've tracked the preview issue down the following type of merge code:

{ ADDRESSBLOCK \f " <<_STREET_
>><<_STREET2_
>><<_CITY_ etc

There is also one starting with GREETINGLINE. Anything with this type of code has started to fail to update properly in preview mode.

Anything that is { Mergefield Name } updates just fine.

EDIT: I've replaced all the code and now the previews update properly.

macropod
06-08-2019, 10:43 PM
Instead of using the ADDRESSBLOCK & GREETINGLINE fields, insert the actual merge fields you require.