Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: adding a context menu in Outlook

Geek News

adding a context menu in Outlook
"donald" <jonathan[ at ]dorling.biz> 3/19/2006 1:09:31 PM
Hi there,

How can i add a button to the Right-mouse context menu in Outlook?

Thanks

Donald

Re: adding a context menu in Outlook
Rog <rog_21[ at ]yahoo.com> 3/19/2006 4:21:32 PM
Hi Donaly you need to attach to the the CommandBars.OnUpdate event look
for the this._explorer.CommandBars["Context Menu"];
This will be the command bar you then need to add your buttons to.
Rog





donald wrote:
[Quoted Text]
> Hi there,
>
> How can i add a button to the Right-mouse context menu in Outlook?
>
> Thanks
>
> Donald
>
Re: adding a context menu in Outlook
"donald" <jonathan[ at ]dorling.biz> 3/19/2006 5:15:18 PM
thanks Rog

that work just lovely

Re: adding a context menu in Outlook
Adi 4/17/2006 9:44:01 AM
Hi,

I tried to initialise the Context menu during startup. But it does not show
up.
Is there anything i missed?

Or should i initialise the Context menu on CommandBar.update ?

thanks

"donald" wrote:

[Quoted Text]
> thanks Rog
>
> that work just lovely
>
>
Re: adding a context menu in Outlook
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 4/17/2006 12:44:40 PM
Use the .Update event.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Adi" <Adi[ at ]discussions.microsoft.com> wrote in message
news:1BBB02A6-1074-46AB-B8D8-8D4FE2966A53[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> I tried to initialise the Context menu during startup. But it does not
> show
> up.
> Is there anything i missed?
>
> Or should i initialise the Context menu on CommandBar.update ?
>
> thanks

Re: adding a context menu in Outlook
Adi 5/2/2006 11:47:02 PM
Hi,

It still does not work.
And i think it should be .OnUpdate and not .Update as there is no such event
for COmmandBars.

I am pasting my code here. Please help me out.

OnStartupComplete()

{

.........
.......

_CommandBarsEvents_OnUpdateEventHandler oUpdate = new
_CommandBarsEvents_OnUpdateEventHandler(onUpdate);
this.commandBars.OnUpdate += oUpdate;

.......
}
public void onUpdate()
{

try
{
this.toolbarButton2 =
(CommandBarButton)this.commandBars["Context"].Controls["Up"];

}
catch (Exception e)
{
this.toolbarButton2 =
(Microsoft.Office.Core.CommandBarButton)this.commandBars["Context"].Controls.Add(MsoControlType.msoControlButton,
System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value);
this.toolbarButton2.Caption = "Up";
this.toolbarButton2.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonAutomatic;
}

this.toolbarButton2.Tag = "Up";
this.toolbarButton2.Visible = true;
this.toolbarButton2.Priority = 1;
this.toolbarButton2.Enabled = true;


}

Am i missing something?


"Ken Slovak - [MVP - Outlook]" wrote:

[Quoted Text]
> Use the .Update event.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Adi" <Adi[ at ]discussions.microsoft.com> wrote in message
> news:1BBB02A6-1074-46AB-B8D8-8D4FE2966A53[ at ]microsoft.com...
> > Hi,
> >
> > I tried to initialise the Context menu during startup. But it does not
> > show
> > up.
> > Is there anything i missed?
> >
> > Or should i initialise the Context menu on CommandBar.update ?
> >
> > thanks
>
>
Re: adding a context menu in Outlook
Rog <rog_21[ at ]yahoo.com> 5/3/2006 12:49:40 PM
Try using "Context Menu" instead of "Context"

Rog

Adi wrote:
[Quoted Text]
> Hi,
>
> It still does not work.
> And i think it should be .OnUpdate and not .Update as there is no such event
> for COmmandBars.
>
> I am pasting my code here. Please help me out.
>
> OnStartupComplete()
>
> {
>
> ........
> ......
>
> _CommandBarsEvents_OnUpdateEventHandler oUpdate = new
> _CommandBarsEvents_OnUpdateEventHandler(onUpdate);
> this.commandBars.OnUpdate += oUpdate;
>
> ......
> }
> public void onUpdate()
> {
>
> try
> {
> this.toolbarButton2 =
> (CommandBarButton)this.commandBars["Context"].Controls["Up"];
>
> }
> catch (Exception e)
> {
> this.toolbarButton2 =
> (Microsoft.Office.Core.CommandBarButton)this.commandBars["Context"].Controls.Add(MsoControlType.msoControlButton,
> System.Reflection.Missing.Value, System.Reflection.Missing.Value,
> System.Reflection.Missing.Value, System.Reflection.Missing.Value);
> this.toolbarButton2.Caption = "Up";
> this.toolbarButton2.Style =
> Microsoft.Office.Core.MsoButtonStyle.msoButtonAutomatic;
> }
>
> this.toolbarButton2.Tag = "Up";
> this.toolbarButton2.Visible = true;
> this.toolbarButton2.Priority = 1;
> this.toolbarButton2.Enabled = true;
>
>
> }
>
> Am i missing something?
>
>
> "Ken Slovak - [MVP - Outlook]" wrote:
>
>> Use the .Update event.
>>
>> --
>> Ken Slovak
>> [MVP - Outlook]
>> http://www.slovaktech.com
>> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
>> Reminder Manager, Extended Reminders, Attachment Options
>> http://www.slovaktech.com/products.htm
>>
>>
>> "Adi" <Adi[ at ]discussions.microsoft.com> wrote in message
>> news:1BBB02A6-1074-46AB-B8D8-8D4FE2966A53[ at ]microsoft.com...
>>> Hi,
>>>
>>> I tried to initialise the Context menu during startup. But it does not
>>> show
>>> up.
>>> Is there anything i missed?
>>>
>>> Or should i initialise the Context menu on CommandBar.update ?
>>>
>>> thanks
>>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net