Change Content of Embedded Textboxes in Word using VBA
Word Document might contain text boxes embedded in it as Inlineshapes. In that case, it can be manipulated using VBA as follows:
Sub Document_TextBoxes()
Dim oCtl As InlineShape
Dim oTB
For Each oCtl In ActiveDocument.InlineShapes
If oCtl.OLEFormat.ProgID = "Forms.TextBox.1" Then
Set oTB = oCtl.OLEFormat.Object
oTB.Text = "Sample Text"
End If
Next
End Sub
0 comments:
Post a Comment