Create a rich text control field in VBA for Word 2010

Posted by mkn on Stack Overflow See other posts from Stack Overflow or by mkn
Published on 2012-09-29T14:49:39Z Indexed on 2012/09/29 15:37 UTC
Read the original article Hit count: 271

Filed under:
|

I have a control field where I dynamically add certain text. That works well so far. The problem is that in one text I have an input field where the user can type in text.

I need to hardcode the form text input field into the VBA code. How is this achieved? Or can someone point me in the right direction?

In the following code snippet I need to replace the [InputField] by a VBA input field.

ActiveDocument.SelectContentControlsByTitle("Bottom").Item(1).Range.Text = _
"Some Text" & vbNewLine & _
"Some Text" & vbNewLine & _
"Some Text" & vbNewLine & _
"Text [InputField] Text"

© Stack Overflow or respective owner

Related posts about vba

Related posts about word-2010