Mail Merge with Word 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I cannot find out anywhere how I do a mail merge in Word 2003 that will not
print out blank spaces from blank fields of data. For example, I have a
mailing list wherein some persons have middle initials and some don't - I
don't want extra spaces printed out for the ones who don't have an initial in
this field. Help please!
J.
 
I use the following code to automate a WORD 2003 mail merge using a MS
Access 2003 table as the data source. If the the empty initial field is
set to NULL (not to space) you should not get a blank space out of the
merge.

====

' =============================================
' mailmerge the Visitor Envelopes
' =============================================
Set objWord = Nothing
' Dim objWord As Object
Set objWord = GetObject(Application.CurrentProject.Path & "/Welcome
Envelopes.dot", "Word.Document")

' Make Word visible.
objWord.Application.Visible = True

' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:=Application.CurrentProject.Path & "/Database 2006.mdb", _
LinkToSource:=True, _
Connection:="TABLE [Temp Mail Merge]", _
SQLStatement:="SELECT * FROM [Temp Mail Merge]"

' Execute the mail merge.
objWord.MailMerge.Execute

objWord.Close
 
Back
Top