Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-10-2021, 04:35 PM
Guessed's Avatar
Guessed Guessed is offline Programatically create Fully Functional DropdownList (or ComboBox) Content Controls Windows 10 Programatically create Fully Functional DropdownList (or ComboBox) Content Controls Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default


I think your clue of using the built-in UI provides an 'almost' acceptable method.
Code:
Sub Attempt4()
  Dim oCC As ContentControl
  Application.CommandBars.ExecuteMso ("ContentControlDropDownList")
  Set oCC = Selection.Range.Paragraphs(1).Range.ContentControls(1)  'this line is a weak attempt that could be more elegant
  With oCC
    .DropdownListEntries.Add "A", "Apples"
    .DropdownListEntries.Add "B", "Beets"
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia

Last edited by Guessed; 01-10-2021 at 04:39 PM. Reason: '
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to save docx to doc that checks compatibility and converts content controls to static content. staicumihai Word VBA 4 10-12-2016 08:23 PM
Programatically create Fully Functional DropdownList (or ComboBox) Content Controls Pass combobox content to header wpryan Word VBA 3 07-17-2015 01:44 AM
VBA ppt ComboBox behaivor: 1.OnFocus change value 2. get dropdownlist doesn't disappear after mousec janism22 PowerPoint 2 03-26-2015 12:35 AM
Create UserForm ComboBox or ContentControl ptmuldoon Word VBA 11 01-17-2015 05:58 PM
How to use the content of a combobox for {IF} field? Melaanie Word 0 06-14-2010 02:00 AM

Other Forums: Access Forums

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