![]() |
#1
|
|||
|
|||
![]()
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 |
Tags |
function, public, string |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
John 4 | Word VBA | 6 | 11-19-2020 06:02 AM |
Problem with function | PRA007 | Word VBA | 2 | 01-13-2016 01:11 AM |
![]() |
adj | Word VBA | 9 | 08-30-2014 09:21 PM |
How to reserve an array in a public function? | tinfanide | Word VBA | 2 | 02-27-2012 06:51 AM |
![]() |
Eduardo | Word VBA | 5 | 06-15-2009 01:55 AM |