![]() |
|
#2
|
||||
|
||||
|
You can do it with a list box and a rich text (or plain text) content control and a macro.
You may find https://www.gmayor.com/insert_content_control_addin.htm useful The macro goes in the ThisDocument module of the document. Change the control titles to reflect what you have inserted. Code:
Option Explicit
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oCC As ContentControl
Select Case ContentControl.Title
Case "DropDownBoxTitle"
Set oCC = ActiveDocument.SelectContentControlsByTitle("Code Text").Item(1)
If ContentControl.ShowingPlaceholderText = False Then
Select Case ContentControl.Range.Text
Case "1": oCC.Range.Text = "Text for item 1"
Case "2": oCC.Range.Text = "Text for item 2"
'etc
End Select
End If
Case Else
End Select
Set oCC = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copy Formatted Text in one Rich Text Content Control to another Rich Text Content Control | Haygordon | Word | 1 | 04-05-2019 05:43 AM |
Auto populate text box based on drop-down content control and repeat the process via copy paste
|
helenndp | Word VBA | 2 | 09-27-2018 11:04 AM |
| VBA to provide text string with specific formating based on Drop down list (content control) | MP1989 | Word VBA | 4 | 07-30-2018 02:40 AM |
| Table with content control drop down - change font | DebA | Word | 3 | 04-29-2018 09:07 PM |
Is there a way to anchor drop-down content control boxes so entering text doesn't change formatting?
|
TzarChasm | Word | 7 | 04-14-2016 06:28 PM |