Group: microsoft.public.word.vba.general
From: =?Utf-8?B?RG9yYWs=?=
Date: Monday, April 07, 2008 2:29 PM
Subject: RE: Mail Merge Programming problem

I'm still waiting for someone to be kind enough to look at this and tell me
what to look for to make it work for Word 2007. Please?

"Dorak" wrote:

> In Word, I have a letterhead template that contains a writer's block in table
> format. The macro that gets data from an Excel table works fine in Word
> 2003, but in Word 2007 the merge does not execute. It pulls data only from
> the first row of the table.
> Could someone advise me as to what might be wrong? Below is my code.
>
> Sub findentry()
> '
> ' findentry Macro
> ' Macro recorded 8/7/2007 by Admin
> '
> ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
> ActiveDocument.MailMerge.OpenDataSource Name:= _
> "N:\Templates\EmployeeData.xls", ConfirmConversions:=False,
> ReadOnly:= _
> False, LinkToSource:=True, AddToRecentFiles:=False,
> PasswordDocument:="", _
> PasswordTemplate:="", WritePasswordDocument:="",
> WritePasswordTemplate:= _
> "", Revert:=False, Format:=wdOpenFormatAuto, Connection:= _
> "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data
> Source=N:\Templates\EmployeeData.xls;Mode=Read;Extended
> Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet
> OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine
> Ty" _
> , SQLStatement:="SELECT * FROM `AllPersonnel$`", SQLStatement1:="", _
> SubType:=wdMergeSubTypeAccess
> ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdToggle
> WordBasic.MailMergeFindEntry
> End Sub