Find Button State

D

Duncan McCreadie

I am trying to turn on the find bar when a particular folder is selected but
it seems that the State property is not right.

colCB = applicationObject.ActiveExplorer.CommandBars
objCBB = colCB.FindControl(ID:=5592) ' Find
If Not objCBB Is Nothing Then
If objCBB.State = MsoButtonState.msoButtonUp Then objCBB.Execute()
End If


I have tried repeating the state test line, thinking that the state might
not be "remembered" but would be set by the first command. However, it
seems like it always has a state of msoButtonDown after execute whatever the
state beforehand.
Any ideas on what I can do differently?

Duncan
 
D

Duncan McCreadie

vb.net in the first instance although I have a similar set of symptoms in
VBA.

Duncan
 
K

Ken Slovak - [MVP - Outlook]

Is WordMail being used? I've seen similar problems with WordMail and reading
button.state. Even if the button state is correct in the UI in the code it's
wrong. The workaround I've used for that is to store the button state in a
boolean variable in my code and update it in the click handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top