How to get the text written in a Plain Text Content Control in Word via VBA

1.5k Views Asked by At

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:
Information about the content control I want to get text from

1

There are 1 best solutions below

2
On BEST ANSWER

Provided your content controls have unique titles it can be as simple as:

preparerText = ActiveDocument.SelectContentControlsByTitle("PreparerText")(1).Range.Text