View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Merging to A, B,C...

You can try a macro like

Sub OneMergePerInitialLetter()
' error trapping to be added
Dim iLetter As Integer
Dim objMMMD As Word.Document
dim strSheetName As String
dim strColumnName
' Set this to the name of the worksheet or to the range name
strSheetName = "Sheet1$"

' Set this to the exact name of the column containing the name
' (upper/lower case is probably significant
strColumnName = "mycolumn"

Set objMMMD = ActiveDocument
With objMMMD
For iLetter = Asc("A") To Asc("Z")
.MailMerge.DataSource.QueryString = _
" SELECT * FROM [Sheet1$]" & _
" WHERE ucase(t) like '" & Chr(iLetter) & "%'"
With .MailMerge
' remove or change this as necessary
.Destination = wdSendToNewDocument
.Execute Pause:=False
End With
If MsgBox("Completed Letter " & Chr(iLetter) & _
". Do the next letter?", vbOKCancel) = vbCancel Then
Exit For
End If
Next
End With
Set objMMMD = Nothing
End Sub

See e.g. Graham Mayor's page at
http://www.gmayor.com/installing_macro.htm
if you need help on installing and running macros.

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Michael Koerner wrote:
Peter;

Thanks very much what you posted is what I'm looking for only I don't know
how to use what you posted.

The second part was to select the records in 100 record increments to create
the merge documents. Different than selecting from the Alpha characters.