Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-16-2022, 10:01 PM
gmayor's Avatar
gmayor gmayor is offline populate a rich text with the selected value of a droplist? Windows 10 populate a rich text with the selected value of a droplist? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
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

The selected value of a list control is the range.text. You can identify a control by its tag which is by default the same as its title, though either can be changed as required. Frankly it is difficult to see why you would put the list value in a text CC when it is already displayed in the list CC, but if you wish to do so then use the ControlOnExit event to make the update e.g. in your document.



Code:
Option Explicit

Private Sub Document_ContentControlOnExit(ByVal cc1 As ContentControl, Cancel As Boolean)
    If cc1.ShowingPlaceholderText = False Then
        ActiveDocument.SelectContentControlsByTitle("a").Item(1).Range.Text = cc1.Range.Text
    End If
End Sub
__________________
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



Similar Threads
Thread Thread Starter Forum Replies Last Post
populate a rich text with the selected value of a droplist? Importing content control data from excel and populate two fields on selected dropdown badarlodhi Word VBA 8 02-08-2023 10:47 AM
populate a rich text with the selected value of a droplist? Find and Replace Selected Text or Macro for finding selected text mrplastic Word VBA 4 12-20-2019 01:25 PM
Copy Formatted Text in one Rich Text Content Control to another Rich Text Content Control Haygordon Word 1 04-05-2019 05:43 AM
My plain text post got converted to rich text in a reply, how to convert it back? david.karr Outlook 0 01-05-2012 09:46 AM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:03 PM.


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