【重要】在Word VBA中用集合(Collection)遍历inlineshape控件
2017-04-03 17:16阅读:
在Word
VBA中用集合(Collection)遍历inlineshape控件
━━━━━━━━━━━━━━━━━━━━━━━━━
胡子注:在word中插入多个单选按钮制作选择题,问卷调查等很方便。但由于vba不支持控件数组,所以写代码很麻烦。网上有许多VBA玩家用类方法实现控件数组,我看了一下还是不简单,于是用集合试了一下,实在是太方便了!
Dim col As New Collection
Private Sub
Document_Open()
col.Add
OptionButton1
col.Add OptionButton2
col.Add OptionButton3
col.Add OptionButton4
col.Add OptionButton11
col.Add OptionButton21
col.Add OptionButton31
col.Add OptionButton41
col.Add OptionButton12
━━━━━━━━━━━━━━━━━━━━━━━━━
胡子注:在word中插入多个单选按钮制作选择题,问卷调查等很方便。但由于vba不支持控件数组,所以写代码很麻烦。网上有许多VBA玩家用类方法实现控件数组,我看了一下还是不简单,于是用集合试了一下,实在是太方便了!
Dim
Private
