mail merge

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
more a question really about word and a database, but someone might have a handle on this.

One of the fields is an address field, in the database it is stored name, address, postcode

the address part holds carriage returns

using merge I have been unable to remove the carriage returns, I need the address supplied as a single line,

anyone know of a way in the merge to substitute / remove the carriage return with either a space or comma and space

word 2007 is currently changing the formatting on the second line down, and i don't seem to be able to control that as I think its related to the default paragraph in word, and the merge document is created as a temp file on a server.

I can't do any processing on the document itself beyond merge codes, or change the database format
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi mole,

Word fields have no string manipulation capabilities to edit their contents - what's in the database is what you get.

If you're using Word's Address Block field for outputting the address, you might find it best not to do so and, instead, insert the individual mergefields into your mailmerge main document. That gives you greater flexibility in how the fields are laid out (it still won't resolve all your issues if there are carriage returns in the source data, though).

As for Word changing the formatting, I'd suggest that's a problem with the Style definition of whatever paragraph Style is applied to the paragraph in which the mergefield is located. Change the Style to one that reflects your needs and the problem should go away.
 
Last edited:
Upvote 0
The database is and does record complaints, inquests, all sorts of personal, confidential or sensitive information.

Talking about styles has put a thought in my head, though, although the database front serves a temp word document, you have me now thinking if i can force the template to maintain the style, and store that in the system (guess push comes to shove remove all formatting and at least it would look the same).

I assumed that there might be something in the merge code that I could use, like formatting controls for dates etc

Thanks for the response
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,887
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top