Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-13-2015, 09:13 PM
macropod's Avatar
macropod macropod is offline Create UserForm ComboBox or ContentControl Windows 7 64bit Create UserForm ComboBox or ContentControl Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
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

The macro I posted in the link you gave is only for populating the dropdown; not for doing anything with whatever might be selected. If you select an item from the populated dropdown, that item should be displayed.

If you want to work with (e.g. display) something else from the workbook according to the item selected, you should add whatever that is to the dropdown as the item Value when populating the content control. For example:
Code:
ActiveDocument.ContentControls(1).DropdownListEntries.Add Text:=Trim(.Range("A" & i)), Value:=Trim(.Range("B" & i))
Then, when you exit the content control after making your selection, use a Document_ContentControlOnExit macro to retrieve the value and put it somewhere else. For code to do that, see: https://www.msofficeforums.com/word-...html#post46903. You already seem to be doing much the same.

For what you're trying to do, if there is always only one chart to display in a given document, could have the field code already in the document and just change the chart reference (that being what you'd use for the content control Value).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
Create UserForm ComboBox or ContentControl Is it possible to take an input from a UserForm in one document to a UserForm in a do BoringDavid Word VBA 5 05-09-2014 09:08 AM
Create UserForm ComboBox or ContentControl Trying to Reference a ContentControl Using DocProperty SuzeG Word VBA 4 12-17-2013 03:40 PM
Create UserForm ComboBox or ContentControl Activate/ select ContentControl czsti Word VBA 1 08-14-2013 08:32 AM
ComboBox ListIndex = -1 even though it does NOT = -1 Joe Patrick Word VBA 0 08-03-2011 08:34 AM

Other Forums: Access Forums

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