Reputation: 25
I still haven't understood how to use VBA in Word. I have a Plain Text Content Control, where our employees will write some text. This text will be added to an email. But how do I get this text? I would like something like this:
preparerText = ActiveDocument.ContentControls("PreparerText").Range.Text
But it doesn't work.
I have tried to Google how to do this, but cannot find an answer (or perhaps the answer is there, but I just don't understand how to use it in my context)
Information about the content control I want to get text from:
Upvotes: 1
Views: 2267
Reputation: 7850
Provided your content controls have unique titles it can be as simple as:
preparerText = ActiveDocument.SelectContentControlsByTitle("PreparerText")(1).Range.Text
Upvotes: 2