A
Al
Greetings,
I would like to merge data from a SQL database. I run the code below in the
word document. However, the form's fields, firstname, and lastname do not
update from <<FirstName>> to say Tom, once the "execute" line runs. Am I
missing something to update the form's fields.
Maybe can someone provide working sample code? Thanks in advance.
-- CODE
ActiveDocument.MailMerge.CreateDataSource _
Name:="Pro_Users", _
SQLStatement:="Select * from tblUsers", _
Connection:="Persist Security Info=False;User
ID=xxx;password=psxxx;server=myserver;database=Pro;", _
LinkToSource:=True
ActiveDocument.MailMerge.Execute
-- END CODE
--
Regards,
Al
I would like to merge data from a SQL database. I run the code below in the
word document. However, the form's fields, firstname, and lastname do not
update from <<FirstName>> to say Tom, once the "execute" line runs. Am I
missing something to update the form's fields.
Maybe can someone provide working sample code? Thanks in advance.
-- CODE
ActiveDocument.MailMerge.CreateDataSource _
Name:="Pro_Users", _
SQLStatement:="Select * from tblUsers", _
Connection:="Persist Security Info=False;User
ID=xxx;password=psxxx;server=myserver;database=Pro;", _
LinkToSource:=True
ActiveDocument.MailMerge.Execute
-- END CODE
--
Regards,
Al