Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-25-2021, 07:39 AM
JamesWood JamesWood is offline Listbox to select field name from data Windows 10 Listbox to select field name from data Office 2019
Advanced Beginner
Listbox to select field name from data
 
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
 

Tags
listbox



Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox to select field name from data Yet another Multi-Select Listbox in Userform question Javir Word VBA 4 09-24-2019 01:01 AM
How to filter data before it is pulled into combobox/listbox AND remove data from listbox Izzii0x Excel Programming 8 05-24-2019 07:25 AM
Add-In creates ListBox from XLS, but data not saved in ppt barbet PowerPoint 0 05-26-2016 02:30 AM
How to use an ActiveX Control to insert a multi select listbox in Word marksm33 Word 2 01-29-2014 05:21 PM
Listbox to select field name from data Multi-select listbox help gvibe@hotmail.com Word VBA 1 07-19-2013 10:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft