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

Quote:
Originally Posted by gmayor View Post
Do you mean like

Code:
Private Sub UserForm_Initialize()
Dim lngFld As Long
    With ActiveDocument.MailMerge.DataSource
        ListBox1.Clear
        For lngFld = 1 To .FieldNames.Count
            ListBox1.AddItem .FieldNames(lngFld)
        Next
    End With
End Sub


So I'm wondering how I can store one of the fields as a string. So basically on the listbox, I click on the desired field name, then when I click OK it stores that field name as a string. Any thoughts please? Thanks so much
Reply With Quote