Your code doesn't make much sense to me.
There's an obvious error with 'End Sub' appearing before 'Option Explicit'.
Then you have a Document_Open macro that selects the 'ColourDropDown' bookmark and then calls an 'Index' macro that tries to populate a variable 'i' with whatever appears in the corresponding formfield's internal bookmark after 'ColourDropDown'. A coding error there means the code falls over that that point. If it worked, 'i' would always be 0, since the formfield's name is the same as the 'ColourDropDown' bookmark itself. So what is the point of the 'i' variable?
If the above worked, you would then have your formfield call the 'ColorDropDown' macro, whose code looks for a formfield named '"DropDown" & i' which, if anything, would always evaluate to 'DropDown0'. But no such formfield exists - the dropdown formfield's name is only ever 'ColourDropDown' and no other formfield with a name like '"DropDown" & i' exists in the document.
Finally, even if you resolve all of the above, your code would set the Dropdown selection's font and background to the same colour, effectively making the text invisible.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|