在文本框中插入字符的问题
现在有一串代码 其功能是在word文档中插入一个文本框
Dim OWork As Object
Dim oDoc As Object
Set OWork = CreateObject("Word.Application")
Set oDoc = OWork.Documents
oDoc.Open (App.Path & "\test.doc")
With OWork.ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 90, 90, 120, 40).Select
End With
然后请问如何在这个文本框中插入字符呢
求代码 江湖救急
拜谢
[解决办法]
帮顶先
[解决办法]
Sub test()Dim myshap As ShapeSet myshap = ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 90, 90, 120, 40)myshap.TextFrame.TextRange.Text = "ok"End Sub
[解决办法]
Sub test() Dim myshap As Shape Set myshap = ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 90, 90, 120, 40) myshap.TextFrame.TextRange.Text = "ok" myshap.Line.ForeColor.RGB = RGB(255, 0, 0) myshap.Line.Weight = 10End Sub
[解决办法]
myshap.TextFrame.TextRange.Alignment=vbCenter