Public function string problem
Hi guys
I have this public string code:
Public Function docNameFieldPreview() As String
docNameFieldPreview = ActiveDocument.MailMerge.DataSource.DataFields("Name").Value
End Function
This works, but if I replace the name section with another string I have, it says "The requested member of the collection does not exist."
Public Function docNameFieldPreview() As String
docNameFieldPreview = ActiveDocument.MailMerge.DataSource.DataFields(docNameField).Value
End Function
Any thoughts? docNameField has been dimmed elsewhere, and does work in other areas of the code that use it, so I'm not sure why it won't work in this particular string.
Thanks a lot
James
|