Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2014, 12:22 AM
gmayor's Avatar
gmayor gmayor is offline VBA Dropdown change list Entries automatically Windows 7 64bit VBA Dropdown change list Entries automatically Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

One possibility is to use a variation of the following function in conjunction with http://www.gmayor.com/document_batch_processes.htm which will handle the files and folders.
Make whatever changes to 'oCC' that you require and the add-in will do the same for all matching files in the folder.



Code:
Function Dropdown(oDoc As Document) As Boolean
Dim oCC As ContentControl
    On Error GoTo Err_Handler
    For Each oCC In oDoc.ContentControls
        If oCC.Title = "Dropdown1" Then
            With oCC
                .Title = "drpVessel"
                .Tag = .Title
                With .DropdownListEntries
                    .Clear
                    .Add "Item 1"
                    .Add "Item 2"
                    .Add "Item 3"
                    .Add "Item 4"
                End With
            End With
            Exit For
        End If
    Next oCC
    Dropdown = True
lbl_Exit:
    Exit Function
Err_Handler:
    Dropdown = False
    Resume lbl_Exit
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Tags
automatically, dropdown, replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Dropdown change list Entries automatically Multiple entries in dropdown lists paul_pearson Word VBA 151 10-18-2023 04:23 PM
Duplicating entries on multiple tabs automatically jbexley Excel 0 08-28-2014 04:48 PM
VBA Dropdown change list Entries automatically Captions automatically updating all previous entries jhats Word 1 07-29-2014 11:53 PM
Dropdown list, Macro shield5 Excel Programming 7 10-27-2013 01:51 AM
Change cell color everytime a value is selected in dropdown list angelica_gloria Excel 4 01-27-2012 06:47 PM

Other Forums: Access Forums

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