Greetings ... Now I cannot for the life of me find references to the below on this forum, in Access or Word VBA help, or even searching Google for that matter ... I don't understand ...
I am trying to call a Word .dot template from Access for a MailMerge function.
I have gleaned from a few posts on this forum ways to call the .dot file using the
command.
see:
here
here
and here
The first and last of these examples uses the command:
Now I can't find any documentation for FormFields(*).Result!* and I can't get it to work ... the result is a runtime error 5941 with the message "The requested member of the collection does not exist"
The actual line of code I am using is
where current is
and where Prefix is the name both of the MergeField in the template being called and the Fieldname of the desired field in the table defined as rst.
I am actually more interested in the second example above but it is much more complex, and doesn't use the FormFields(*).Result!* command. I can't, however, see how it calls data from the Access datasource into the Word document.
As I can't find documentation on any of these commands anywhere I am at a bit of a loss. If anyone kind help me find this documentation, or help me with the code above, I would be very grateful ...
I am trying to call a Word .dot template from Access for a MailMerge function.
I have gleaned from a few posts on this forum ways to call the .dot file using the
Code:
New Word.Application
see:
here
here
and here
The first and last of these examples uses the command:
Code:
New Word.Application.ActiveDocument.FormFields("[I]fieldnamehere[/I]").Result=[I]recordset[/I]![I]FIELDNAMEHERE[/I]
Now I can't find any documentation for FormFields(*).Result!* and I can't get it to work ... the result is a runtime error 5941 with the message "The requested member of the collection does not exist"
The actual line of code I am using is
Code:
current.FormFields("Prefix").Result = rcs!Prefix
Code:
New Word.Application.ActiveDocument
I am actually more interested in the second example above but it is much more complex, and doesn't use the FormFields(*).Result!* command. I can't, however, see how it calls data from the Access datasource into the Word document.
As I can't find documentation on any of these commands anywhere I am at a bit of a loss. If anyone kind help me find this documentation, or help me with the code above, I would be very grateful ...