Easy way to add CommandBarButton to Outlook?

M

mlkditwd

Hello,
I'm serching for an easy way to add a new button to the "Standard"
CommandBar in the Outlook Form "IPM.Note". I've no problem to add a
button to the Standard-CommanBar in the main window, controlled by
Explorer. But I've no idea, how to handle the Inspector.

This is for a project where the user can modify (encryption, add
comments, etc.) a email, if he wish so, before sending the message.
Because that, the button should be next to the "send"-button and not
in a new CommandBar.

It should work with Outlook 2000 and VBA. I hope, that this
explanation is enough


I'm grateful for any suggestion.
 
K

Ken Slovak - [MVP - Outlook]

Similar procedure to adding to an Explorer, trap the NewInspector event and
add the button to the Inspector.CommandBars collection.

Be aware that just like with Explorers if more than 1 Inspector is opened at
a time you will need an Inspector wrapper class and collection with a unique
Tag property for each button to prevent each button's click event handler
from firing if any instance of the button is clicked.

See the ItemsCB COM addin sample at the Resources page at www.microeye.com
for an example of an Explorer wrapper and see
http://www.slovaktech.com/code_samples.htm#InspectorWrapper for an example
of an Inspector wrapper.
 
M

mlkditwd

Thanks for your response. But I use Office Developper 2000 and not
"real" Visual Studio, so I have problems to play with the Outlook COM
AddIn Example from Micro Eye. Is it enough to import the files
"modOutlook.bas" and "OutAddIn.cls"? Because there are some errors
importing "Connect.Dsr". I don't know how to handle the files "Outlook
COM Addin.vbp", "Outlook COM Addin.vbw" and "Connect.DCA".

I've played a bit with the example, but where is gstrProgID defined?
Is there an example in the internet, that can I investigate without
"real" Visual Basic?

Thanks for your effort.
 
K

Ken Slovak - [MVP - Outlook]

Please post part of the preceding thread in your posts, your interface isn't
doing that and it makes it very hard to follow a thread.

You can import the cls and bas files. You can also look at the designer code
in Notepad by using Notepad to view the .DSR file for the designer. That
module has the On_Connection code that defines the progid. The VBP and VBW
files are project files, not needed. The DCA file is a binary of the DSR
file.

Office Developer lets you write COM addins using File, New Project, Addin
Project.
 
M

mlkditwd

OK, it works now! Thank you very much for the quick help. There are
hopefully no more problems with my mailclient, the rest of the posting
should be in the answer.

The example now seems to be comprehensible for me. I'm playing with
ItemsCB and it works. The InspectorWrapper example will I research
later.
 
L

Luc P Maes

Ken,

Your code example for a wrapper seems to me as if it was for VB6 or
something but not VB.NET (sorry for the stupid question but I am new to
VB.... and am more comfortable with Java.... still)...

Is there a big difference with VB.NET (VS 2003) or do you have a VB.NET 2003
version of your inspector wrapper stuff (I constatly receive errors...)

Thnaks in advance
Luc
 
K

Ken Slovak - [MVP - Outlook]

It is for VB 6 and I don't have any VB.NET samples of it because I never use
..NET coding with Outlook, too many problems. I don't know of any Inspector
wrapper examples at all in .NET code and as far as I know my sample is the
only Inspector wrapper out there as a sample.
 
L

Luc P Maes

It looks like it indeed.

Thanks
Luc

Ken Slovak - said:
It is for VB 6 and I don't have any VB.NET samples of it because I never use
..NET coding with Outlook, too many problems. I don't know of any Inspector
wrapper examples at all in .NET code and as far as I know my sample is the
only Inspector wrapper out there as a sample.
 

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