Why Word toolbars are hidden when Outlook with WordMail is launche

H

Hichem S

Hi,
When launching an Outlook application that is configured to use WordMail as
the default mail editor, a Word process is started in background. This word
process will load my word addin that creates a toolbar and a popupmenubar.
Unfortunately when I then open word (after opening Outlook as previously
described), my toolbar is invisible while the popupmenu bar is visible.
Can anybody explain to me what happens? Why Outlook hides the word toolbars?
and what can be done other than making the toolbar visible in the
WindowActivate event of Word. Note that this solution is not satisfying since
we force the visibility of the toolbar to true, while the user might wants to
hide it!!
I really don't want Outlook to hide the Word toolbar :(

Thanks you very much for the answer...
Hichem
 
K

Ken Slovak - [MVP - Outlook]

Handle WindowActivate events in Word object model code in both addins. Test
for wn.EnvelopeVisible = True. That means a WordMail window, False means a
Word.Document window.

You can iterate the CommandBars collections and set your Enabled and Visible
properties as desired. I usually disable the custom Word toolbars in
WordMail and vice versa.

You also have to handle cases where more than one WordMail Inspector and/or
more than one Document are open at a time so multiple copies of toolbars
aren't visible.
 
H

Hichem S

Sorry Ken but this does not answer my question...
I actually went through all you described but I am doing it a little bit
different. I am actually hiding the outlook addin (using
inspector.IsWordMail) and I am using the Word addin when it comes to handle
WordMail (using EnvelopeVisible) : if the Envelope is visible then I treat
the document as an email. If it's not i treat it as a word document. This
solution allow me not to play with WindowActivate/Deactivate to hide and show
the toolbars : In fact only one toolbar is created by application.

I hope this will help to understand my question : When I open Outlook with
wordmail configured (I don't open yet a word application), Outlook hides the
toolbar created by the Word process that was launched in the backgroud
:)wordmail).
If then I open Word my toolbars are infact Invisible...what happened?
 
K

Ken Slovak - [MVP - Outlook]

You need to handle things as I mentioned. It doesn't matter if you want to
hide or show a Word or WordMail toolbar in either setup, you have to do the
same things. You have to iterate the CommandBars collection of the
Word.Document object (Inspector.WordEditor for a WordMail object) and find
the ones you want and enable/disable them as desired and set the visibility
as desired.

What Outlook and WordMail or Word on its own do on their own can be
overridden by your code. You just have to set things up as desired.
 
H

Hichem S

Hi Ken,
Sorry to insist... My purpose with the last answer is to give you the more
element you may need to answer my question.
I want to add that my addin is a shared addin and in the connect I switch on
the application object to decide for the right thing to do.
As I said in my first comment it's unwanted to force the visibility of a
toolbar to true if the user chose to set it to false!...What happens is that
outlook sets the visibility of my toolbar to false which I NEVER DID IN MY
CODE. In fact I never in any place set the visibility of the toolbar to false.
I searched but I did not find any thread talking about this issue. This is
understandable, since you always advice poeple to work on the mail item in
wordmail from an outlook point of view which make this issue undetectable!
 
K

Ken Slovak - [MVP - Outlook]

I understand what you are saying and when Outlook does that you can leave it
as is or use your code to make your UI visible. You can save the last state
of the UI (visible/invisible) when the item is closed in either version and
use that later, but since Outlook is doing this you either have to live with
it or you have to change things in your code.
 
H

Hichem S

Thanks for your answer...
That's exactly what I am doing : save the last state of the UI => the only
way i found to deal with the problem.
But as this is a workaround, I just wanted to know if I can avoid outlook
from doing what it does... and understand why...?
If possible, can you tell me what happens? why outlook does that?
Thanks
 
K

Ken Slovak - [MVP - Outlook]

I don't know why Outlook is doing that in your code and what the Outlook or
WordMail internals are. So your guess is as good as mine is.
 

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