View Single Post
 
Old 03-03-2016, 02:59 AM
highrise955 highrise955 is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Mar 2016
Posts: 37
highrise955 is on a distinguished road
Default

OK, after searching the forum again I think I may have answered the question myself. This code supplied by macropod seems to do the trick...

Quote:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
If .Title = "Name" Then
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
Exit For
End If
Next
ActiveDocument.SelectContentControlsByTitle("Title ").Item(1).Range.Text = StrDetails
End If
End With
End Sub
Thanks macropod!!!

To finish this off can someone point me in the right direction to have the Name field auto-populate upon opening the document? I think this is a "built-in variable" but I don't know how to access it and populate it in the Name field. Also, by auto-populating the Name field can I also auto-populate the Title and if so, how?
Reply With Quote