Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 09-29-2020, 02:49 PM
Charles Kenyon Charles Kenyon is offline Content Control values NOT display name Windows 10 Content Control values NOT display name Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,535
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

And, based on Paul's response to another question, here is a function:


Code:
Function CCValue(ccMyContentControl As ContentControl) As String
    ' Charles Kenyon 29 September 2020
    '
    ' Function based on Paul Edstein's Code
    ' https://stackoverflow.com/questions/58809271/how-to-get-dropdown-value-not-display-text-from-word-content-control-using-vba
    '
    If ccMyContentControl.Type <> wdContentControlDropdownList Then
        If ccMyContentControl.Type <> wdContentControlComboBox Then
            CCValue = ccMyContentControl.range.Text
            Exit Function
        End If
    End If
    Dim i As Long
    With ccMyContentControl
        For i = 1 To .DropdownListEntries.Count
            If .DropdownListEntries(i).Text = .range.Text Then _
                CCValue = .DropdownListEntries(i).Value
        Next i
    End With
End Function
Reply With Quote
 

Tags
content control, value not display name



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Control values NOT display name Code to Sum Column of Content Control Values In Specific Tables? warbird Word VBA 2 07-13-2015 05:44 AM
Word drop-down content control dependent display issue vvcat Word 6 02-03-2015 11:20 PM
how to make building block content control determine bb to display elsewhere jamles12 Word VBA 5 11-16-2013 11:38 AM
Content Control values NOT display name Content control merge values? skrallemand Word VBA 8 10-02-2013 06:54 AM
Content Control values NOT display name Assigning Values to content control checkboxes and calculating results creative cathy Word Tables 13 10-07-2012 08:52 PM

Other Forums: Access Forums

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