Adding outlook command buttons to outlook word editor when composing a mail

  • Thread starter Thread starter urgent help required plz
  • Start date Start date
U

urgent help required plz

Hi,
I have developed a com addin and everything is working
fine but in the last moment, i have found that it dosen't
work when we use mail editor in outlook.

I was trying to add a new tool bar when we compose a mail
and also trying to customize my new toolbar to
automatically contain some already exiting outlook command
buttons using com addin. I.e. I have writeen a COM add-in
to OutLook that adds a new toolbar to the OutLook's
Toolbar. There are two commands(buttons) by
name "Digitally sign Message" and "Encrypt Message
Contents and Attachments". These are already present in
outlook commands. So,These buttons are already present in
the standard command bar (This buttons will come only when
you try to customize the tool bar of new mail). In new
mail window, The location where these are present is:
Tools -> Customize -> Commands ->
In categories select Standard -> on the Right side, if you
scroll down you can see commands(buttons) by
name "Digitally sign Message" and "Encrypt Message
Contents and Attachments".
Below is the code i had written to identify if word is
used as mail editor.

Private Sub colInsp_NewInspector(ByVal Inspector As
Inspector)
Dim objItem As Object
Dim WordDoc As Word.Application

On Error Resume Next



Set objInsp = Inspector
Set objItem = objInsp.CurrentItem

If objInsp.IsWordMail Then
MsgBox "word mail"
Set WordDoc = objInsp.WordEditor
MsgBox "You are using word mail editor"



On the whole, what i am i have placed the above two
commands on my new toolbar that i have created using com
addin. These buttons have ID's of 718 and 719.

Now everything is fine when i use HTML as mail editor. But
when word is used as mail editor, i am also getting the
new inspector event and i am also able to find out what is
the mail editor. But after that, if word is used as
editor, i am not able to add the two buttons with id's 718
and 719 to outlook word mail.

Could you splease send me some information on how to do
this?

Thanks & Regards
 
I feel your pain. I have tried to work this from every
angle. The problem is that the inspector.commandbars
appear to be undefined when Word is the editor. I have
some execs that want this ability, yesterday. I had to
shell a process from a macro; then and use SendKeys with a
few SetForegroundWindow calls to get the functionality. I
am still stuck on getting some feedback, that is, did the
sendkeys actually do the job? I don't want a message
going out unencrypted if the sender thinks it is encrypted!
 
Back
Top