Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2015, 03:29 PM
macropod's Avatar
macropod macropod is offline Content Control Dropdown Dependencies Windows 7 64bit Content Control Dropdown Dependencies 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

The value stored in the dropdown requires some form of separator to delineate the items. It's up to you what separator you use, but no separator will of itself tell Word to put something into a cell - you code has to do that. For example:
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 = .DropdownListEntries(i).Value
        Exit For
      End If
    Next
    With ActiveDocument.Tables(1).Rows(2)
      For i = 0 To UBound(Split(StrDetails, "|"))
        .Cells(i + 1).Range.Text = Split(StrDetails, "|")(i)
      Next
    End With
  End If
End With
End Sub

__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 10-28-2015, 10:07 AM
asteinroeder asteinroeder is offline Content Control Dropdown Dependencies Windows 8 Content Control Dropdown Dependencies Office 2013
Novice
Content Control Dropdown Dependencies
 
Join Date: Oct 2015
Posts: 3
asteinroeder is on a distinguished road
Default

Thanks a lot for your help. I now have it working. My last question is whether I can get certain values of the output to go into different rows. Using the example that was previously used on this thread, if I wanted the Phone number to go into one row and then the Address to go into the next row. I know I could do this by creating multiple drop down menus that reference different rows, but is there a way to do it with one dropdown list?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Control Dropdown Dependencies Move to next content control cksm4 Word VBA 13 07-02-2019 07:48 PM
Content Control Dropdown Dependencies Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
Content Control Dropdown Dependencies Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM
Content Control Dropdown Dependencies Hierarchical content control ntjson Word VBA 1 04-04-2013 12:07 AM
Content Control Dropdown Dependencies Content control titles jillapass Word VBA 3 05-29-2012 06:11 AM

Other Forums: Access Forums

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