View Single Post
 
Old 02-19-2023, 08:56 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,181
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Attached is a sample doc with code in the ThisDocument module. This is using Content Controls and macros to produce the list from check boxes.

The code I used is
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
  Dim aCC As ContentControl, aCCnest As ContentControl, sEndorsements As String
  If ContentControl.Tag = "Update" Then
    For Each aCCnest In ActiveDocument.SelectContentControlsByTitle("Endorsements Picker")(1).Range.ContentControls
      If aCCnest.Checked Then sEndorsements = sEndorsements & aCCnest.Title & vbCr
    Next aCCnest
    ActiveDocument.SelectContentControlsByTitle("Endorsements")(1).Range.Text = sEndorsements
  End If
End Sub
Attached Files
File Type: docm Endorsements.docm (35.8 KB, 20 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote