View Single Post
 
Old 05-25-2021, 08:21 AM
JamesWood JamesWood is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Nov 2020
Posts: 37
JamesWood is on a distinguished road
Default

Actually I managed to make a string from the selected listbox field


' Make a string from the selected listbox field
For var = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(var) = True Then
docNameField = docNameField & ListBox1.List(var) _
& vbCrLf
End If
Next

I'm not sure why I'm getting this error though:


"The requested member of the collection does not exist"


On this line of code:


strDocName = ActiveDocument.MailMerge.DataSource.DataFields(doc NameField).Value & ".pdf"


Thoughts? It's getting stuck at the docNameField part I think but I don't know why.
Reply With Quote