Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
If I have a couple with different last names as a Contact (Nancy Smith and
Don Jones); any way to pick the first names up correctly in the Greeting line in a mail merge? (Dear Nancy and Don). |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Depends upon exactly what fields you have in the data source for the names
of the people. Can you tell us what they are? -- 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, originally posted via msnews.microsoft.com "Portagepa" wrote in message ... If I have a couple with different last names as a Contact (Nancy Smith and Don Jones); any way to pick the first names up correctly in the Greeting line in a mail merge? (Dear Nancy and Don). |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Coming from Outlook (2007); both names in the "Full Name" line.
"Doug Robbins - Word MVP" wrote: Depends upon exactly what fields you have in the data source for the names of the people. Can you tell us what they are? -- 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, originally posted via msnews.microsoft.com "Portagepa" wrote in message ... If I have a couple with different last names as a Contact (Nancy Smith and Don Jones); any way to pick the first names up correctly in the Greeting line in a mail merge? (Dear Nancy and Don). |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
It is not possible to parse such a field in Word. You would have to make
use of (and enter the desired greeting line data) into one of the other fields (nickname is one that you could use) that are available in Outlook. The only other way would be to execute the merge to a new document and then use a macro to go through that document, setting a Range object to the ..Range of the paragraph that contains the data from the Full Name field and modifying the text in that field. The following code will do that if the FullName mergefield is the only thing in the First Paragraph of the mailmerge main document. (It prepends the names with the "Dear ", so it is not necessary to have that in the mail merge main document Dim i As Long Dim fullname As Range Dim Name2 As Range Dim fname1 As Range, fname2 As Range With ActiveDocument For i = 1 To .Sections.Count Set fullname = .Sections(i).Range.Paragraphs(1).Range If InStr(fullname, " and ") 0 Then Set Name2 = fullname.Duplicate Set fname1 = fullname.Duplicate Name2.Start = Name2.Start + InStr(Name2, "and") + 3 Set fname2 = Name2.Duplicate If fullname.Words(2) = "-" Then fname1.End = fullname.Words(3).End Else fname1.End = fullname.Words(1).End End If If Name2.Words(2) = "-" Then Name2.End = Name2.Words(3).End Else Name2.End = Name2.Words(1).End End If fullname.Text = "Dear " & fname1 & "and " & Name2 Else Set fname1 = fullname.Duplicate If fullname.Words(2) = "-" Then fname1.End = fullname.Words(3).End Else fname1.End = fullname.Words(1).End End If fullname.Text = "Dear " & fname1 End If Next i End With -- 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, originally posted via msnews.microsoft.com "Portagepa" wrote in message ... Coming from Outlook (2007); both names in the "Full Name" line. "Doug Robbins - Word MVP" wrote: Depends upon exactly what fields you have in the data source for the names of the people. Can you tell us what they are? -- 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, originally posted via msnews.microsoft.com "Portagepa" wrote in message ... If I have a couple with different last names as a Contact (Nancy Smith and Don Jones); any way to pick the first names up correctly in the Greeting line in a mail merge? (Dear Nancy and Don). |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Importing names from Excel into Word document as part of greeting | Mailmerge | |||
greeting line will not display names in format chosen | Mailmerge | |||
print labels for various names in contacts | Microsoft Word Help | |||
Importing names into greeting | Microsoft Word Help | |||
Add contacts to "Select Names" list | Microsoft Word Help |