View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Merging one line out of multiple lines

It is not that easy to do after the merge. I would manipulate the data
source. If it is a table in a Word Document, Insert a new column after the
last column and then use the following macro

Dim i As Long
Dim company As Range
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
Set company = .Cell(i, 1).Range
company.Collapse wdCollapseStart
company.Select
.Cell(i, .Columns.Count).Range.Text =
Selection.Bookmarks("\line").Range.Text
Next i
End With

This assumes that the address is in the first field. If it is not, change
the 1 in the line

Set company = .Cell(i, 1).Range

to the number of the column that contains the address.

If your data source is not a table in a Word document, use a catalog or
directory type mail merge to create a table that contains the data, then
insert a row at the top of the table into which you enter the names of the
merge fields and then add the column and run the above macro.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Sonja" wrote in message
...
I have copied merged an address field that is all one field. There is a
total of three lines in this field , customer name is on the first line,
address on 2nd line and so on. I would like to take line one the customer
name and place it into another field. Example:
Dear (customer name from first line of address field)

Can you tell me if this is possible?

Thanks in advance for your help!