trim trailing spaces in mergefield

C

claudio

Word 2002
I'm using a Word document containing a table as data source. In the table I
define the mergefields to be used in the Word template. These fields are
filled with data that is always padded with spaces to reach 50 characters in
length. In the merge, I need to insert some of these fields between fixed
text and so I need to remove the unnecessary spaces. Is there a
parameter/option to trim the mergefield?
 
P

Peter Jamieson

Unfortunately assuming that there's nothing you can do about the format
provided to you, the simplest solution to this problem is probably to export
the data from Word into one of the many formats (almost all of them) which
cannot be made to retain trailing spaces.

That said, is there anything you /can/ do about the format provided to you?

Also, are you in a position to use VBA for your merge? If so, you can
consider using Word's MailMerge events to strip trailing spaces, set a
Document variable and use a { DOCVARIABLE } field to insert the result
instead of a { MERGEFIELD } field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top