View Single Post
 
Old 03-24-2017, 10:44 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
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 original thread was: https://www.msofficeforums.com/word-...own-lists.html

Regarding my previous post, your 'Client' dropdown has only one meaningful item, so there's no real point in it being a dropdown, and your 'client details' content control isn't a dropdown either, so you can't choose from any of its 'Description, 'Manufacturer', 'Model', 'Serial No.', or Cal. Due' entries. Hence my comments re a lack of clarity.

But, yes, it is possible to modify the macro to populate a series of table cells. For example:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Dim i As Long, j As Long, StrDetails As String
With CCtrl
  If .Title = "Client" Then
  For i = 1 To .DropdownListEntries.Count
    If .DropdownListEntries(i).Text = .Range.Text Then
      StrDetails = .DropdownListEntries(i).Value
        For j = 0 To UBound(Split(StrDetails, "|"))
          .Range.Rows(1).Cells(j + 2).Range.Text = Split(StrDetails, "|")(j)
        Next
      Exit For
    End If
  Next
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote