scottintexas
Programmer
This may be too new for any answers but since I am trying to make this work I might as well ask one of the masters here. I have placed a ContentControl (Text) on my document. The Tag is txtTractID. I want to grab the text the user puts in that control and put it in the second text control. Then I put this code to work.
The Set objTract2 throws an error. I just can't figure out how to set the object. I found the Word Developer Help a little lacking in help. Maybe I'm just not getting it. Any help would be greatly appreciated.
ScottInTexas
It's probably as hard as it looks.
Code:
Dim objTract As ContentControl
Dim objDoc As Document
Dim objTract2 As ContentControl
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
If ContentControl.Tag = "txtTract" Then
Set objTract2 = objDoc.ContentControls("txtTract2")
objTract2.Range.Text = ContentControl.Range.Text
End If
End Sub
Private Sub Document_New()
Set objDoc = ActiveDocument
End Sub
The Set objTract2 throws an error. I just can't figure out how to set the object. I found the Word Developer Help a little lacking in help. Maybe I'm just not getting it. Any help would be greatly appreciated.
ScottInTexas
It's probably as hard as it looks.