jamielawjen
Jan 27th, 2006, 07:41 AM
hi there
i need to check first that a control exists before adding new one,
how do i do this
i have the following code, but im not sure how to check if the control object is filled or not
Dim testcontrol As Office.CommandBarControl
Set testcontrol = objApp.ActiveExplorer.CommandBars.item("Menu Bar").controls.item("My Control")
If testcontrol = false Then
'add control
else
'control exists
end if
alternatively, is there some way chekc if a control exists like
objApp.ActiveExplorer.CommandBars.item("Menu Bar").controls.exists("my control")
i am using vb6, outlook 2000+
many thanks
Jamie
i need to check first that a control exists before adding new one,
how do i do this
i have the following code, but im not sure how to check if the control object is filled or not
Dim testcontrol As Office.CommandBarControl
Set testcontrol = objApp.ActiveExplorer.CommandBars.item("Menu Bar").controls.item("My Control")
If testcontrol = false Then
'add control
else
'control exists
end if
alternatively, is there some way chekc if a control exists like
objApp.ActiveExplorer.CommandBars.item("Menu Bar").controls.exists("my control")
i am using vb6, outlook 2000+
many thanks
Jamie