Hi All
I am new to VB and I'm having difficulty retrieving text from a content control
Below is the code that i have come up with but it doesn't seem to work.
When I use the {valuecc = "test"} line it works but when i try the line below it doesn't.
Can anyone tell me where i'm going wrong?
Thanks
Jeffaus
Code:
Private Sub Swapcc(doc As Document, tagcc As String)
Dim cc As ContentControl
Dim valuecc As String
'valuecc = "test"
valuecc = ActiveDocument.ContentControlsbyTag(tagcc).Range.Text
For Each cc In Documents(doc).ContentControls
If cc.tag = tagcc Then
cc.Range = valuecc
End If
Next
End Sub