|
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "表格满页"
- .FaceId = 372
- .OnAction = "表格满页"
- End With
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "表格缩行"
- .FaceId = 371
- .OnAction = "表格缩行"
- End With
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "表格自动编号"
- .FaceId = 1095
- .OnAction = "表格自动编号"
- End With
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "减少行高热键"
- .FaceId = 541
- .OnAction = "减少行高热键"
- End With
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "减少行高微调热键"
- .FaceId = 36
- .OnAction = "减少行高微调热键"
- End With
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "表格行高循环"
- .FaceId = 3526
- .OnAction = "表格行高循环"
- End With
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "表格外框加粗"
- .FaceId = 1705
- .OnAction = "表格外框加粗"
- End With
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = "表格全选"
- .FaceId = 165
- .OnAction = "表格全选"
- End With
复制代码
可以精简为:
- Dim i&
- Dim arr
- arr = array("表格满页",372,"表格缩行",371,"表格自动编号",1095,"减少行高热键",541,"减少行高微调热键",36,"表格行高循环",3526,"表格外框加粗",1705,"表格全选",165)
- for i = 0 to ubound(arr) step 2
- With CommandBars("Tables and Borders").Controls.Add(Type:=msoControlButton)
- .Caption = arr(i)
- .onAction = arr(i)
- .FaceId = arr(i+1)
- end with
- next i
复制代码 |
|