Hi,
I've Tried using the following code. But it is returning Run time error. Please see attached screen of error.
Code:
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("Details").Item(1).Range.Text = StrDetails
End If
End With
End Sub
My document is not protected. And i don't understand why i am getting this error. Could you please tell how to fix this?
Thanks
Laxman