I have a WORD doc that has several checkboxes and a button. I change the number of checkboxes on the page often (add/remove).
When the button is pressed, a macro opens a file associated with every checkbox using this form:
if CB1 then
Documents.Open FileName:="c:\mydirectory\" + CB1.Caption
end if
if CB2 then
Documents.Open FileName:="c:\mydirectory\" + CB1.Caption
end if
Checkboxes are named CB1, CB2, CB3.....
How can I have the macro go through the document and open every file associated with a checked checkbox without having to constantly alter my script (one day I'll have boxes 1-10 another I'll have 1-3, 9-12, another I'll have 1-5,9,143, etc....)?
When the button is pressed, a macro opens a file associated with every checkbox using this form:
if CB1 then
Documents.Open FileName:="c:\mydirectory\" + CB1.Caption
end if
if CB2 then
Documents.Open FileName:="c:\mydirectory\" + CB1.Caption
end if
Checkboxes are named CB1, CB2, CB3.....
How can I have the macro go through the document and open every file associated with a checked checkbox without having to constantly alter my script (one day I'll have boxes 1-10 another I'll have 1-3, 9-12, another I'll have 1-5,9,143, etc....)?