我在Word中创建了一个文本框,我想在其中插入文本:
Sub k()
Dim Box As Shape
Set Box = ActiveDocument.Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=50, Top:=50, Width:=100, Height:=100)
//HOW TO INSERT HERE TEXT INTO TEXT BOX
End Sub
答案 0 :(得分:3)
以下是解决方案:
Sub k()
Dim Box As Shape
Set Box = ActiveDocument.Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=50, Top:=50, Width:=100, Height:=100)
'The solution for you:
Box.TextFrame.TextRange.Text = "My text comes this way"
End Sub