Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 10-01-2013, 12:28 AM
macropod's Avatar
macropod macropod is offline Content control merge values? Windows 7 32bit Content control merge values? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

I don't see where you've previously mentioned that the 'Value' column has anything other than the Display Name (default).

Getting values can be problematic if two or more have the same display names, as there's no vba for directly querying the displayed name's index #. Accordingly, one has to loop through all of them and compare the display name each against each list entry. Subject to that caveat, try:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim StrOutput As String, CtrlID As String, i As Long
If ContentControl.Type <> wdContentControlDropdownList Then Exit Sub
For Each ContentControl In ContentControls
  With ContentControl
    If .Type = wdContentControlDropdownList Then
      If .Title = "Input" Then
        If .Range.Text <> .PlaceholderText Then
          For i = 1 To .DropdownListEntries.Count
            If .DropdownListEntries(i) = .Range.Text Then
              StrOutput = StrOutput & .DropdownListEntries(i).Value & "+"
            End If
          Next
        Else
          StrOutput = StrOutput & "N/A" & "+"
        End If
      End If
    End If
    If .Title = "Output" Then CtrlID = .ID
  End With
Next
StrOutput = Left(StrOutput, Len(StrOutput) - 1)
ContentControls(CtrlID).Range.Text = StrOutput
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content control merge values? Move to next content control cksm4 Word VBA 13 07-02-2019 07:48 PM
Content control merge values? Hierarchical content control ntjson Word VBA 1 04-04-2013 12:07 AM
Content control merge values? Content control titles jillapass Word VBA 3 05-29-2012 06:11 AM
Retrieving content control value jillapass Word VBA 4 05-24-2012 05:07 AM
Calendar control accepts other values JeJ Word 0 03-02-2011 03:38 PM

Other Forums: Access Forums

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