Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 10-28-2015, 03:56 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,523
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

If your table has 5 columns throughout, you could use:
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(5).Range
      For i = 0 To 14
        .Cells(i + 11).Range.Text = Split(StrDetails, "|")(i)
      Next
    End With
  End If
End With
End Sub
Otherwise, you could use:
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(5)
      For i = 0 To 4
        .Rows(3).Cells(i + 1).Range.Text = Split(StrDetails, "|")(i)
      Next
      For i = 5 To 9
        .Rows(4).Cells(i - 4).Range.Text = Split(StrDetails, "|")(i)
      Next
      For i = 10 To 14
        .Rows(5).Cells(i - 9).Range.Text = Split(StrDetails, "|")(i)
      Next
    End With
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



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