View Single Post
 
Old 03-25-2017, 08:37 AM
gennatr12 gennatr12 is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Mar 2017
Posts: 4
gennatr12 is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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

I just wanted to thank you for helping me out. I was trying to figure out a way so that when you select an option from the drop-down list content control(the one under the 'Asset No.' column) it would fill out the remaining adjacent table cells. So in the attached document you can select an asset number from the drop-down list and it will populate the table cells with the corresponding data(description, manufacturer, model, serial, and calibration due). When it's all said and done the drop-down list will have a lot more options to choose from, but for now this was just an example for me to test everything out. I may have more questions later on, but for now this is exactly what I needed. Again, thank you so much for your help.
Attached Files
File Type: docm Equipment List - Copy.docm (30.2 KB, 16 views)
Reply With Quote