
Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
Thanks, that works great, what I would now like to do is expand the code to
run for each loaded UserForm (I have over 20 Userforms).
I did try the code below, but it seems to repeating he opitonbuttons and
checkboxes for each new UserForm it moves to:
Dim oButtonArray() As OptionButton
Dim oCheckboxArray() 'As CheckBox
Dim i As Long
Dim j As Long
Dim oControl As Control
Dim UF As Object
Load xxFrm
Load yyFrm
Load zzFrm
For Each UF In UserForms
For Each oControl In UF.Controls
If TypeOf oControl Is MSForms.OptionButton Then
ReDim Preserve oButtonArray(i)
Set oButtonArray(i) = oControl
i = i + 1
GoTo SkipRest
End If
If TypeOf oControl Is MSForms.CheckBox Then
ReDim Preserve oCheckboxArray(j)
Set oCheckboxArray(j) = oControl
j = j + 1
End If
SkipRest:
Next oControl
For i = 0 To UBound(oButtonArray)
ActiveDocument.Range.InsertAfter UF.Name & "," & oButtonArray(i).Name &
"," & oButtonArray(i).Caption & vbCr
Next i
For j = 0 To UBound(oCheckboxArray)
ActiveDocument.Range.InsertAfter UF.Name & "," & oCheckboxArray(j).Name
& "," & oCheckboxArray(j).Caption & vbCr
Next j
Next UF
> Red6000,
>
[quoted text clipped - 52 lines]
>>
>> Thanks
red6000 - 21 May 2006 10:10 GMT
Right I've got it to work by moving NextUF to aftert NextControl, but I've
had to lose prefixing the text with the UserForm Name.
> Thanks, that works great, what I would now like to do is expand the code
> to run for each loaded UserForm (I have over 20 Userforms).
[quoted text clipped - 95 lines]
>>>
>>> Thanks
red6000 - 21 May 2006 10:14 GMT
Okay, I want to go back to having the NextUF at the end, but just before
that I need code to reset and clear the original created array, is this
possibl?
Thanks for the help.
> Right I've got it to work by moving NextUF to aftert NextControl, but I've
> had to lose prefixing the text with the UserForm Name.
[quoted text clipped - 98 lines]
>>>>
>>>> Thanks
red6000 - 21 May 2006 10:23 GMT
Okay, all sorted now.
> Okay, I want to go back to having the NextUF at the end, but just before
> that I need code to reset and clear the original created array, is this
[quoted text clipped - 104 lines]
>>>>>
>>>>> Thanks