以下是引用cn_dragon在2007-3-19 12:13:59的发言:我在word 中插入一个按钮,如何对其进行定位,然后改变他的CAPTION属性什么的? 上次的答复是:application.inlineshape.addOLEControl......这个代码我在进行宏录制的时候已经看到,但是我想知道的是如何确定它的位置,然后对它进行改变属性或者操作!谢谢!! '* +++++++++++++++++++++++++++++ '* Created By SHOUROU@ExcelHome 2007-3-20 6:26:40 '仅测试于System: Windows NT Word: 11.0 Language: 2052 '№ 0184^The Code CopyIn [ThisDocument-ThisDocument]^' '* ----------------------------- Sub Example() Dim myRange As Range, myInlineshape As InlineShape, myControl As Object With ActiveDocument Set myRange = .Range(0, 0) Set myInlineshape = .InlineShapes.AddOLEControl(ClassType:="Forms.CommandButton.1", Range:=myRange) Set myControl = myInlineshape.OLEFormat.Object With myControl .Caption = "ExcelHome" .Width = 100 .Height = 60 End With End With End Sub '----------------------
|