Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2016, 02:25 AM
macropod's Avatar
macropod macropod is offline Dropdownlist-Parsing values to various ContentControls Windows 7 64bit Dropdownlist-Parsing values to various ContentControls 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


Perhaps you should study the thread your code was lifted from more closely: https://www.msofficeforums.com/word-...own-lists.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 03-07-2016, 02:55 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

Quote:
Originally Posted by macropod View Post
Perhaps you should study the thread your code was lifted from more closely: https://www.msofficeforums.com/word-...own-lists.html

I did and I was thinking the following code in post #33 of that thread might be what I am looking for...

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
    With ActiveDocument
      .SelectContentControlsByTitle("ClientAddress").Item(1).Range.Text = StrDetails
      If StrDetails <> " " Then StrDetails = _
      .SelectContentControlsByTitle("Client").Item(1).Range.Text & Chr(11) & StrDetails 
      .SelectContentControlsByTitle("ClientDetails").Item(1).Range.Text = StrDetails
    End With
  End If
End With
End Sub
But I just can't seem to understand how to direct the different values to the various contentcontrols. I'm sure it's staring at me right in the face but I'm just not getting it.

For example, let's say the user types in the number 4444-333-55555.

And that number in the combobox (named: "Drawing Number") has the following values:

Laser Assembly RH|Steel, Polycarb|Rev N

I want the first value to go to a contentcontrol named "Product Description" and the second value to go to a contrentcontrol named "Material" and so on...

Thanks for any input you can offer.
Reply With Quote
Reply



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 05:49 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