A
ALPHA DAVIS
Hi,
I've created a Word template of mailing labels and the data source is a
SQL2000 view. It's working just fine when I click on the Merge icon on the
menu. I want the template to automatically merge the data source and crate
the labels when I double click on the file (not open to edit the template),
which creates a new document based on this template, without having to click
on the Merge icon on the menu. I added the following VBA code but it is
still not merging automatically. I appreciate some suggestion or help on
how to make this work.
p.s., what is a Main Document definition? I think the State condition below
is verifying for a Main documetn.
Private Sub Document_New()
If ActiveDocument.MailMerge.State = wdMainAndDataSource Then
ActiveDocument.MailMerge.Execute
End Sub
I've created a Word template of mailing labels and the data source is a
SQL2000 view. It's working just fine when I click on the Merge icon on the
menu. I want the template to automatically merge the data source and crate
the labels when I double click on the file (not open to edit the template),
which creates a new document based on this template, without having to click
on the Merge icon on the menu. I added the following VBA code but it is
still not merging automatically. I appreciate some suggestion or help on
how to make this work.
p.s., what is a Main Document definition? I think the State condition below
is verifying for a Main documetn.
Private Sub Document_New()
If ActiveDocument.MailMerge.State = wdMainAndDataSource Then
ActiveDocument.MailMerge.Execute
End Sub