Forum Discussion
Rename a text box in Word
Hi Deon_Olivier,
o rename textboxes in Word 365 / 2019, follow these steps:
- Select the textbox you want to rename.
- Go to the Developer tab.
- Click the Selection Pane button in the Arrange group.
- **In the Selection Pane, right-click the textbox and select Rename.
- **Enter a new name for the textbox and click OK.
Note: If the Developer tab is not visible, right-click on the ribbon and select Customize the Ribbon. Then, check the box next to Developer and click OK.
Example:
To rename a textbox named "TextBox1" to "MyTextBox", you would follow these steps:
- Select the textbox named "TextBox1".
- Go to the Developer tab.
- Click the Selection Pane button in the Arrange group.
- In the Selection Pane, right-click the textbox named "TextBox1" and select Rename.
- Enter "MyTextBox" in the Name field and click OK.
Once you have renamed the textbox, you can reference it in your Access code using the following syntax:
ActiveDocument.Shapes("MyTextBox").TextFrame.TextRange
For example, to get the text in the textbox named "MyTextBox", you would use the following code:
Dim myTextBox As TextFrame Set myTextBox = ActiveDocument.Shapes("MyTextBox").TextFrame Dim myText As String myText = myTextBox.TextRange.Text
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)