About state of encrypt and sign button for outlook?

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

ryotyankou via OfficeKB.com

It is very strange that i couldn't get the buttons' state currently for first
time open an e-mail(draft) or create a new one. I firstly find the button
then get_State. return value is S_OK. but state is error.
When i open the second e-mail, all are ok?Why?Thank you.
 
K

Ken Slovak - [MVP - Outlook]

I've often found with WordMail, if this relates to that, that Outlook loses
its references and I have to reinstantiate the button object when I want to
use something like State, even in the Click() event for that button.
 
R

ryotyankou via OfficeKB.com

Hi, ken, My case is not as the same as what you described. If in word editor
mode, get_State is always ok. If without word editor, i found it is error if
you open for first time, close one e-mail you opened, then open any ones it
will be ok. If you don't do "close" action, it may be not correct.
 
K

Ken Slovak - [MVP - Outlook]

I've never seen that with the Outlook editor in any version of Outlook.

When are you getting your button references? In what event? Is it the first
Inspector.Activate() event handler? That's where you should be creating your
UI.
 
R

ryotyankou via OfficeKB.com

Outlook editor? I mean outlook use internal editor, not word editor, i called
it "outlook editor", i'm sorry for that.

Yes, you're right, i create my UI in first inspecotr Active event, and get
outlook encrypt and sign button reference before create UI.

If it is word editor, state is ok, if it is not word editor, just like what i
mentioned, if you do not close an inspector before getstate, it is not
correct.

I've never seen that with the Outlook editor in any version of Outlook.

When are you getting your button references? In what event? Is it the first
Inspector.Activate() event handler? That's where you should be creating your
UI.
Hi, ken, My case is not as the same as what you described. If in word
editor
[quoted text clipped - 16 lines]
 
K

Ken Slovak - [MVP - Outlook]

Everyone calls the internal editor the Outlook editor.

I haven't seen the problem you're having at all with the Outlook editor, but
I really don't work with the sign and encrypt stuff much since there really
isn't much you can do with it in code. Post some of the code you're using to
set up your UI and maybe someone can see something to indicate why you're
having the problem you're having.
 
R

ryotyankou via OfficeKB.com

It is really strange. And i check my situation again and again, it is just as
what i said.
1. outlook editor, you must open a inspector and close it, then
CommandBarButton::get_state will work. If you don't do close action,
get_state alway return Office::msoButtonUp.
2. word editor, it is ok.

my code is quite disordered, following code is just the flow:
1. OnConnection DispEventAdvise(NewInspector)
2. NewInspectorEvent Create a wrapper class and add to list.
3. In Wrapper class DispEventAdvise(InspectorActive event and Close
event)
3. InspectorActive event check if the toolbar not create yet,
CreateToolbar
4. CreateToolbar Find outlook's encrypt and sign button(here i
can get CommandBarButton
object), then get_State. Then Add new
button, set its state by checking
outlook button's state.
5. If use close inspector remove current inspector from list.
6. If use close outlook DisConnection actions.
That's all.
 
K

Ken Slovak - [MVP - Outlook]

I don't know, I don't see that here. You might need to open a support case
with MS to find out what's going on.
 

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