C
CES
All,
I am having problems with a field that I am exporting to a Microsoft Word Mail merge. Basically the gist of the module is it loops through a database table and finds all residents who live at a specific address and then exports each name, that it encounters to a string ie: [name] vbCrLf [Name] vbCrLf {etc}, (you can find the code below). So far so good . However I am encountering a problem once the field is formatted in Word using align center, the first name in the spring is justified right,
and each successive names in the string are justified center. I’ve tried adding vbCrLf prior to the first name, however, I am still getting the same formatting problem. I was hoping that someone might be able to help me with this problem. Thanks in advance. - CES
Do While Not .EOF
If strTmp = .Fields("aStreetNum") & .Fields("aStreetName") & .Fields("aAptNum") & .Fields("aZip") Then
If x > 0 Then
strToReturn = strToReturn & vbCrLf
End If
If .Fields("cFName") <> "" Then
name = .Fields("cFName") & " "
End If
If .Fields("cMName") <> "" Then
name = name & .Fields("cMName") & " "
End If
If .Fields("cLName") <> "" Then
name = name & .Fields("cLName") & " "
End If
strToReturn = strToReturn & name
x = x + 1
End If
.MoveNext
Loop
I am having problems with a field that I am exporting to a Microsoft Word Mail merge. Basically the gist of the module is it loops through a database table and finds all residents who live at a specific address and then exports each name, that it encounters to a string ie: [name] vbCrLf [Name] vbCrLf {etc}, (you can find the code below). So far so good . However I am encountering a problem once the field is formatted in Word using align center, the first name in the spring is justified right,
and each successive names in the string are justified center. I’ve tried adding vbCrLf prior to the first name, however, I am still getting the same formatting problem. I was hoping that someone might be able to help me with this problem. Thanks in advance. - CES
Do While Not .EOF
If strTmp = .Fields("aStreetNum") & .Fields("aStreetName") & .Fields("aAptNum") & .Fields("aZip") Then
If x > 0 Then
strToReturn = strToReturn & vbCrLf
End If
If .Fields("cFName") <> "" Then
name = .Fields("cFName") & " "
End If
If .Fields("cMName") <> "" Then
name = name & .Fields("cMName") & " "
End If
If .Fields("cLName") <> "" Then
name = name & .Fields("cLName") & " "
End If
strToReturn = strToReturn & name
x = x + 1
End If
.MoveNext
Loop