形如“
With ThisDocument
.Shapes("SubjectText").Visible = msoTrue ”
在 word里文本框"SubjectText" 如何设置???
上面是在word 的vb编辑器里的一段代码,我想问,name"SubjectText" ,在word页面添加的文本框,是如何设置这个名称的?
=====================
只能使用代码的方式命名吗? 我是想知道 界面上如何给这个文本框命名???
=====================
楼下的这个,意思是 写这个宏 执行添加 文本框并命名吗? 但是这个得到的文本框 名称都是一样的?
word操作界面上添加 文本框 的话,如何给她命名呢??
第1个回答 推荐于2016-09-15
Sub newTextbox()
Dim docNew As Document
Dim newTextbox As Shape
'Create a new document and add a text box
Set docNew = Documents.Add
Set newTextbox = docNew.Shapes.AddTextbox _
(Orientation:=msoTextOrientationHorizontal, _
Left:=100, Top:=100, Width:=300, Height:=200)
'Add text to the text box
newTextbox.TextFrame.TextRange = "Test"
End Sub本回答被提问者采纳
Dim docNew As Document
Dim newTextbox As Shape
'Create a new document and add a text box
Set docNew = Documents.Add
Set newTextbox = docNew.Shapes.AddTextbox _
(Orientation:=msoTextOrientationHorizontal, _
Left:=100, Top:=100, Width:=300, Height:=200)
'Add text to the text box
newTextbox.TextFrame.TextRange = "Test"
End Sub本回答被提问者采纳