Link to home
Start Free TrialLog in
Avatar of mahalakshmi_s
mahalakshmi_s

asked on

Mail Merge in VBA

Hi,

I want SINGLE DOCUMENT as output.This single doc must have one letter every page. My following code produces a letter in separate document. Pls give the code where i can create one single doc with all letters/page.

This is VBA scipt in word.

Thanks
M

Set New Document and save it with EventNbr postfix
Set NewDoc = ActiveDocument
Savepath$ = exepath$
File_Name$ = Savepath$ + "\Train2_OutputFile" + CurrRec$
NewDoc.SaveAs FileName:=File_Name$
NewDoc.Close

If CurrentRecord < EndRecord Then
  MainDoc.Close SaveChanges:=wdDoNotSaveChanges
  WordBasic.FileNew template:=template$
End If
ASKER CERTIFIED SOLUTION
Avatar of wuerzi
wuerzi
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial