View Single Post
 
Old 08-27-2014, 10:46 AM
lucky16 lucky16 is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jan 2014
Posts: 21
lucky16 is on a distinguished road
Default

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
Attached Images
File Type: jpg Capture.JPG (105.0 KB, 62 views)
Reply With Quote