Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-07-2016, 01:56 AM
highrise955 highrise955 is offline Dropdownlist-Parsing values to various ContentControls Windows 10 Dropdownlist-Parsing values to various ContentControls Office 2013
Advanced Beginner
Dropdownlist-Parsing values to various ContentControls
 
Join Date: Mar 2016
Posts: 37
highrise955 is on a distinguished road
Default Dropdownlist-Parsing values to various ContentControls

Hi All!



I have a combobox with multiple entries on my template. Each entry has multiple values separated by the "|" symbol. When the template loads, a userform pops up asking the user to type in a number. That number is then put into the combobox in my document. I then want the various values for the combobox entry (assuming they typed in a number that is listed in the combobox) to be placed into various contentcontrols in my document.

I know how to do it if the entry has only ONE value but I'm a little confused with multiple values. Here is the code I am currently using to act on just ONE value for an unrelated action...

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
  If .Title = "Client" Then
  For i = 1 To .DropdownListEntries.Count
    If .DropdownListEntries(i).Text = .Range.Text Then
      StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
      Exit For
    End If
  Next
  ActiveDocument.ContentControls(2).Range.Text = StrDetails
  End If
End With
End Sub
I hope I am explaining this correctly.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA ppt ComboBox behaivor: 1.OnFocus change value 2. get dropdownlist doesn't disappear after mousec janism22 PowerPoint 2 03-26-2015 12:35 AM
ActiveDocument.ContentControls(ID) not working Tejas.T Word VBA 3 03-09-2015 06:50 PM
Updating grouped ContentControls in Word 2010 MGerhard Word VBA 3 08-04-2014 02:34 AM
Dropdownlist-Parsing values to various ContentControls Parsing 'FullName' column - help needed text to column ScottA Excel Programming 3 05-06-2014 12:49 PM
XML parsing & Object variable not set (Error 91) tinfanide Excel Programming 0 12-29-2011 08:43 AM

Other Forums: Access Forums

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