VBA and Word mail merge query options


I have a macro which execute several mail merges. I have this instruction to select the options I need for the first mail merge:

ActiveDocument.MailMerge.DataSource.QueryString = _

"SELECT * FROM `Master` WHERE ((Surname >= 'A') AND _(Surname < 'B')) ORDER BY Surname, Firstname" & ""

I need to replace the 'A' and 'B' for variables because I have to do a mail merge for each character of the alphabet. I thought I could have this:

Dim Alphabet As Variant

Alphabet = Array("A", "B", "C", ......, "Z")

I tried to replace the 'A' by Alphabet(0) and the 'B' by Alphabet(1) but it doesn't work.

Can somebody please help me? Thank you!

Josianne Marsan

Logistec Stevedoring Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!