Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-09-2019, 12:12 AM
aussiew aussiew is offline Mac OS X Office 2016
Novice
 
Join Date: Mar 2019
Posts: 3
aussiew is on a distinguished road
Default Assigning Macro to Drop Down list Content Control

Hi,

I have the following:

A document I sent to a customer when they select one of the 3 products. The 3 products are nicely listed in a 3 column table. I have a 3 column table depicting the 3 products with grey font color. If the customer selected product 1, I am formatting the table to change the font color to black for the selected product in this case column 1.



I am trying to do the following:

I inserted a Drop Down list Content Control object in the document and added 4 Items in drop down list. Prod1, Prod2, Prod3 and "Select Product".

I also created a macro that will select a column from a table in the same document and change the font color of the selected product. the macro works fine but I cannot find a way to assign this macro to the Drop Down List. I do not wish to use the legacy drop down list because I tried this and the document needs to be protected, which introduces other issues.

I would appreciate some guidance or anyone pointing me out to a similar thread.

cheers

aussiew

Last edited by aussiew; 03-09-2019 at 06:20 AM. Reason: assigning macro to Drop Down list Content Control
Reply With Quote
  #2  
Old 03-09-2019, 08:56 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,390
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

You don't assign an ordinary macro to a content control. Rather, you use a ContentControlOnExit macro and/or a ContentControlOnEntry macro. See, for example, the content control code in: http://www.msofficeforums.com/word-v...html#post47254. See also: http://www.msofficeforums.com/word-v...html#post46903
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 03-10-2019, 09:08 AM
aussiew aussiew is offline Mac OS X Office 2016
Novice
 
Join Date: Mar 2019
Posts: 3
aussiew is on a distinguished road
Default

I have tried adding my macro to entry and/or exit. The examples you pointed out change the contents of the DropDown List. What I want to is when I select an option from the DropDown List, a table further down in the document (I have created a bookmark for the table) will change the font color.

cheers

aussie
Reply With Quote
  #4  
Old 03-10-2019, 02:36 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,390
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

I'd have thought it pretty obvious that, in that case, you'll need to adjust the code to suit your particular requirements.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 03-10-2019, 02:52 PM
aussiew aussiew is offline Mac OS X Office 2016
Novice
 
Join Date: Mar 2019
Posts: 3
aussiew is on a distinguished road
Default

I don't understand. the code works as a standalone macro. I am not sure what i need to adjust.

cheers

aussie
Reply With Quote
  #6  
Old 03-10-2019, 02:55 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,390
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Since you haven't posted any code or the document, no one here can tell you what you might need to change.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Tags
conditional formatting, drop down list content

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting - Duplicates - Apply to specified range music_al Excel Programming 1 01-25-2017 05:34 AM
Can I apply conditional formatting to text in a drop down menu? Keokira Word 1 04-07-2016 08:22 AM
The Logic Behind Apply Formatting of Surrounding Text in Reveal Formatting Pane Instructor Mark Word 4 04-06-2016 01:32 PM
Can't reset form fields (Word 2013) and conditional formatting rogelinepaula Word VBA 24 01-07-2016 03:54 PM
Conditional Formatting: How to dynamically apply to an expanding table? tinfanide Excel 0 10-18-2013 06:34 AM


All times are GMT -7. The time now is 10:13 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft