CommandBar Not Added If Word Isn't Email Editor

S

StevenBr

I've written an add-in that uses the CommandBars collection of an inspector
to add a custom toolbar.

Now I find that, unless I'm using Word as my email editor, the new toolbar
does not appear. I'm assuming that this is due to the fact that the
CommandBars collection is added by Word.

What objects do I need to use to do the same thing if the user isn't using
WordMail?

Thanks!
 
K

Ken Slovak - [MVP - Outlook]

It should work for Inspector.CommandBars no matter whether Word is the email
editor or not.

What are you using as a reference for the CommandBars collection and what
code are you using?
 
S

StevenBr

Thanks for confirming that; I did find the reason it wasn't working in my
code. However, this leads me to another question: how do I figure out the
type of item my inspector contains? I only want to add my commandbar if the
type of item is mailitem. I don't want the commandbar to be added to an
inspector in any other circumstance.

Thanks!
--
Steven Bras
Tessitura Network, Inc.


Ken Slovak - said:
It should work for Inspector.CommandBars no matter whether Word is the email
editor or not.

What are you using as a reference for the CommandBars collection and what
code are you using?
 
S

StevenBr

Forget my last post; I've figured that out. What I meant to ask is whether or
not there's a way to determine if a mail item in an inspector is "sendable."
By this I mean that it's either a new unsent message, one opened from the
Drafts folder, or an inspector opened using the Resend menu option.

In essence, I don't want to add my commandbar to any inspector that doesn't
have a "send" button already there.

Thanks.
--
Steven Bras
Tessitura Network, Inc.


Ken Slovak - said:
It should work for Inspector.CommandBars no matter whether Word is the email
editor or not.

What are you using as a reference for the CommandBars collection and what
code are you using?
 
P

Peter Huang [MSFT]

Hi

Commonly we programming Outlook based its Object Modal.
But based on my research, the Outlook Object modal did not expose such a
property to judge if a mail is sendable, it did not control over such a
small granularity.

Anyway for Inspector object, there is a currentitem property which will
tell us if it is a mail.
Inspector.CurrentItem.Class
for a mail, its valuse is olMail.

Also for the different scenario for using Word as mail editor or not, we
have different behavior.
For non Word Editor, the Send button is of the Inspector's Standard
toolbar, we can check all the buttons in the toolbars.
For Word Editor, the send button is in the special toolbar, we have to
consider it should be sent.

Hope this helps.


Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
K

Ken Slovak - [MVP - Outlook]

Inspector.CurrentItem.Class. For example:

If Inspector.CurrentItem.Class = olMail Then
 
K

Ken Slovak - [MVP - Outlook]

If you open an existing item Item.EntryID will not be a null string on
opening it. A new item would have .EntryID as a null string. An item that
was previously sent would also have Item.Sent = True.

If you open a reply or forward the only way to tell is a hack. Does it have
RE: or FWD: in the subject (or something like AW: for German, etc.). You can
also tell by the ConversationIndex property, it gets longer by 10 bytes for
each new message in a conversation thread.
 

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