Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 11-15-2018, 02:18 PM
macropod's Avatar
macropod macropod is offline fill in a drop-down list with filenames Windows 7 64bit fill in a drop-down list with filenames Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Private Sub Document_ContentControlOnEnter(ByVal CCtrl As ContentControl)
Application.ScreenUpdating = False
Dim strFolder As String, strFile As String
With CCtrl
  .DropdownListEntries.Clear
  .Type = wdContentControlText
  .Range.Text = ""
  .Type = wdContentControlDropdownList
  Select Case .Tag
    Case "List1": strFolder = ActiveDocument.Path & "\list1\"
    Case "List2": strFolder = ActiveDocument.Path & "\list2\"
    Case "List3": strFolder = ActiveDocument.Path & "\list3\"
  End Select
  strFile = Dir(strFolder & "*.doc", vbNormal)
  While strFile <> ""
    .DropdownListEntries.Add strFile
    strFile = Dir()
  Wend
End With
Application.ScreenUpdating = True
End Sub
Your can add/delete dropdowns and their list folders, as desired.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
drop-down list



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down box list based on response to another drop down box Phideaux Excel 16 04-13-2018 03:07 AM
Document with drop down field for attorney. How to fill in the address etc in other fields. ElfegoBaca Word 3 09-27-2017 09:00 AM
fill in a drop-down list with filenames How to get a Drop Down List Content Control box to fill in other areas snips1982 Word 2 03-22-2017 03:37 AM
Fill - White, Drop Shadow formatting in PP 2013 dave3point0 PowerPoint 2 12-28-2015 04:23 PM
Populate Word Drop-down list with Excel column then auto fill form fields with Excel data Faldinio Word VBA 7 10-19-2014 06:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:35 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