How do I get the value of a textbox in Word?
I know in excel this is the right syntax: ActiveSheet.Shapes(x).Name.
I thought in word this would be the right syntax
ActiveDocument.Shapes(x).Name,
but this doesn’t seems to work.
With this piece of code I also couldn’t find a textbox:
For i = 1 To ActiveDocument.Shapes.Count
MsgBox ActiveDocument.Shapes(i).Name
Next i
I used tags (object properties -> assign a tag name) to edit the object’s value. Use this syntax to change the value of a content control:
ActiveDocument.SelectContentControlsByTag("Your-Content-Control-Tag").Item(1).Range.Text = "your-preferred-value"Anyway, thanks Rachel Hettinger for your patience ;).