Encrypt and sign button while word is editor for outlook?

  • Thread starter ryotyankou via OfficeKB.com
  • Start date
R

ryotyankou via OfficeKB.com

Thanks to Ken Slovak, my toolbar problem were resolved, Thanks him very much
again.
But now i meet another problem:
While use word as editor, i couldn't find encrypt and sign button at all. My
purpose is to make my created button keep same state as encrypt or sign, when
sign is pressed, my button is down, vice versa. So my thought is catch click
event for the two button, while word is NOT editor, i can find the buttons
and DispEventAdvise on them. Another solution i tried is, Enum all windows,
to find the button's window handle. I use SPY++ get the handle for toolbar
they docked. EnumChildWindow return error code "invalid handle". and i get
the toolbar's parent handle is ok, and the result is What handle i get from
toolbar's parent is the same i saw in SPY++, so i think the buttons may be
drawed by code not real button. So any suggestions or tips or point out my
errors? Thanks in advance.
In a word, i want to keep my buttons' state as the same with outlook's
encrypt or sign button.Thank you again.
 
R

ryotyankou via OfficeKB.com

I have another question, following description is assume IsWordEditor ==
false:
when inspector is actived(inspector active event), i can get outlook's
encrypt and sign button state without error code, but it is not correct. Say
i create a new message, change the state of button(push down or up), and save
the message. then open again, in active event find button and getState always
return omsButtonUp, what's going on?
 
R

ryotyankou via OfficeKB.com

I find a way to get the state of the two button, use
WindowFromAccessibleObject and AccessibleObjectFromWindow, the returned
control(sign and encrypt button of outlook IsWordEditor == true) is a
IAccessiblePtr. Then my purpose changed to monitor the click event of the
buttons. I guess that Office::ICommandBarButtonEvents should be use for
advise event. But when i call ICommandBarButtonEvents::DispEventAdvise,
return E_NOINTERFACE. Why?
Office::_CommandBarButton is derived from IAccessible and can be advised, why
my returned IAccessiblePtr couldn't be advised?? TIA.
 
R

ryotyankou via OfficeKB.com

I am sorry for my poor english, am i offend some people unwittingly? That's
not my real intention. Or just have no ideas on this question? This quesiton
is already posted three days, but nobody reply it or just give me some tips.
I am quite confused.
 
K

Ken Slovak - [MVP - Outlook]

If no one responds that means no one has the answer for you. Your posts did
not offend anyone that I'm aware of.
 
R

ryotyankou via OfficeKB.com

OK, i got it, thank you Ken. :)
If no one responds that means no one has the answer for you. Your posts did
not offend anyone that I'm aware of.
 

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