ActiveX Text Box Value

How to get text box value in Word? I know in , this is the correct syntax ActiveSheet.Shapes(x).Name.

I thought in , this should be the correct syntax
   ActiveDocument.Shapes(x).Name,
but this does not seem to work.

With this part of the code, I also could not find the text box:

For i = 1 To ActiveDocument.Shapes.Count
    MsgBox ActiveDocument.Shapes(i).Name
Next i
+5
source share
2 answers

I used tags (object properties -> assign a tag name) to edit the value of the object. 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 to Rachel Hettinger for your patience;).

+1
source
  • , : ActiveDocument.Shapes(1).TextFrame.TextRange.Text

  • ActiveX (OLEobjects), , TextBox1 - , ActiveDocument.TextBox1.Value

  • ActiveX, : ActiveDocument.InlineShapes(1).OLEFormat.Object.Name

+9

All Articles