Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 12-13-2018, 03:03 PM
gmaxey gmaxey is offline Changing words depending on the dropdown list Windows 10 Changing words depending on the dropdown list Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

While it takes a bit more work, in cases involving combobox or dropdown list, you can leverage the ContentControlBeforeStoreUpdate event. It provides a pseudo change event. To make it work, you have title and map the content controls.




Code:
Private Sub Document_ContentControlBeforeStoreUpdate(ByVal ContentControl As ContentControl, Content As String)
Dim oNode As CustomXMLNode
Dim lngIndex As Long
  If ContentControl.Tag = "Master" Then
    Select Case Content
      Case 1, 2, 3
         For lngIndex = 1 To 5
          Set oNode = ContentControl.XMLMapping.CustomXMLPart.SelectSingleNode(Replace(ContentControl.XMLMapping.XPath, "Master", "Slave" & lngIndex))
          oNode.Text = "Gender " & Content & " output " & lngIndex & " text"
        Next lngIndex
      Case Else
        For lngIndex = 1 To 5
          Set oNode = ContentControl.XMLMapping.CustomXMLPart.SelectSingleNode(Replace(ContentControl.XMLMapping.XPath, "Master", "Slave" & lngIndex))
          oNode.Text = ChrW(8203)
        Next lngIndex
      End Select
  End If
lbl_Exit:
  Exit Sub
End Sub
Attached Files
File Type: docm change text.docm (58.4 KB, 26 views)
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/

Last edited by gmaxey; 12-14-2018 at 07:28 AM.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find (highlight) two and more words in a list of 75k single words in Word 2010 Usora Word 8 05-29-2018 03:34 AM
Selection of a dropdown creates another dropdown wih the list krishnamurthy.ka2810 Word VBA 1 04-26-2018 11:44 PM
how to shows cells range depending on dropdown menu value mfran2002 Excel 5 10-26-2017 08:08 AM
Dropdown list - Words with spaces Challebjoern Excel Programming 0 05-23-2017 04:09 AM
Changing dropdown list colors in office 2010 forms Barry Bolton Word 1 02-19-2014 03:26 PM

Other Forums: Access Forums

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