Outlook Add-in

M

Marius

Hello,

I have made an Outlook Add-In with Visual Basic 6.0.
The Add-In makes an Toolbar and all workes fine.

Now, I want to click an Button on these Toolbar from another Programm. How
can I do this?

Thanks for an answer.

Sincerely,
Marius
 
K

Ken Slovak - [MVP - Outlook]

What Outlook version? Where is the button, on an Inspector or an Explorer?

In general you can get an Explorer button for the active Explorer using code
to find the button such as:

Dim button As Office.CommandBarButton

' ol is an Outlook.Application object already instantiated, this code
assumes button added
' to Standard toolbar

Set button = ol.ActiveExplorer.CommandBars("Standard").FindControl(Tag
:= "MyTag")
If Not (button Is Nothing) Then
button.Execute
End If
 
M

Marius

Hey,

Thank you.

Do you have any ideas, why the Button in Outlook after this Function not
released?

Thanks,

Sincerely,
Marius
 
K

Ken Slovak - [MVP - Outlook]

What do you mean it isn't released? Is it still there if Outlook is started
without your code running?

If so that means you didn't set Temporary := True when you created the
button, that Outlook didn't close properly or that you didn't delete the
button as a belt and suspenders safety precaution when the relevant Explorer
or Inspector was closed. Or a combination of all three.

I always create my UI using the Temporary argument and also delete the UI
when the container closes. That way you are never left with relic UI stored
in the outcmd.dat file.
 
M

Marius

Hello Ken,

I mean the Button was pressed an not released after ist was pressed.

I know that with the Temporary flaq.

It's OK but not first class.

Thank you
Sincerely,
Marius
 
K

Ken Slovak - [MVP - Outlook]

Unless you change the State of the button it shouldn't look "pressed" when
you call Execute.
 

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