I wonder if someone can help me. I have been trying to do this for a couple of days to no avail.
I am using a Word Mailmerge Template to connect to a data source from Access. The Word document will be opened by a hyperlink.
At the moment I have set a macro to merge automatically if the template is opened which is ok but it merges all records.
Ideally, what I would like to do it is to pass a value/bookmark from the hyperlink (i.e. c:/DocA.doc#CompanyA) to the merge template which would then use that value at the criteria of the merge.
This is the code I am playing with at the moment:-
ActiveDocument.MailMerge.DataSource.QueryString = _
"select * from [tblGoEast] where (([GEDID = [value/bookmark))" & ""
What I would like to happen is click on the hyperlink which merges the template with the data from the criteria i.e. Document A with Company A's data only.
Any ideas/advice would be appreciated.
Regards
Smilla