Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Portagepa Portagepa is offline
external usenet poster
 
Posts: 5
Default Greeting line for contacts with two names

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   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 Greeting line for contacts with two names

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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Portagepa Portagepa is offline
external usenet poster
 
Posts: 5
Default Greeting line for contacts with two names

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   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 Greeting line for contacts with two names

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing names from Excel into Word document as part of greeting critterharbor Mailmerge 1 June 12th 08 02:27 AM
greeting line will not display names in format chosen shikkiah Mailmerge 1 June 5th 08 09:08 PM
print labels for various names in contacts Nate Collins Microsoft Word Help 1 August 27th 05 12:26 AM
Importing names into greeting bantha3 Microsoft Word Help 1 June 15th 05 05:45 PM
Add contacts to "Select Names" list Old Shrimp Microsoft Word Help 1 April 30th 05 01:29 AM


All times are GMT +1. The time now is 07:00 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"