I have a question about dynamic Control-names in a Dotm or Docm (template w macro or document w macro)
as there will be alot of code, if hardcoding the controlnames.
I am not so used to word programming more java etc but hopefully one can do the same in word VBA and use "alias" variables for controls right?
As I have a relation: Combobox1 should change Label1.caption when changed, Combobox2 should change Label2.caption when changed
This seemed to be a good idea. But no luck here , nothing seems to work
my erroneous tries:
Code:Public Sub ComboBox1_Change() DoLabel ("1") End Sub Public Sub DoLabel(ByVal nr As String) MsgBox (nr) Dim ctr As Control, nameStr As String 'ctr= "Label" & nr ctr.Name = "Label" & nr Me.ctr.Caption = "Show this text" 'Also tried Me.ctr."Label" & nr.Caption="show this text" namestr="Label"&nr 'me.namestr.Caption="show this text" End Sub





Reply With Quote
