Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Ribbon question (http://www.outlookbanter.com/add-ins-outlook/94026-ribbon-question.html)

John Erickson[_2_] August 22nd 09 11:13 AM

Ribbon question
 
Hi,

I'm trying to repurpose some of the controls on the mail inspector ribbon.
Are the ribbon controls available in the Office::_CommandBars collection? If
so, under which control are they located? I've looked in the most obvious
one. The one called "Ribbon", but at the time the NewInspector event triggers
I only see one control listed under that collection. Are they added after the
NewInspector event? If so, when is the ideal time to look for them?

John

Ken Slovak - [MVP - Outlook] August 24th 09 02:13 PM

Ribbon question
 
The ribbon controls are not in the CommandBars collection. You need to use
the XML schema for Outlook to know what XML to write for your ribbon
controls and to handle built-in controls in the ribbon. You then set up
callbacks for the things exposed by the schema and make all of your
customizations that way.

You can download the ribbon schemas from the Office developer Web site.
There are also samples there for how to use the ribbon.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"John Erickson" wrote in message
...
Hi,

I'm trying to repurpose some of the controls on the mail inspector ribbon.
Are the ribbon controls available in the Office::_CommandBars collection?
If
so, under which control are they located? I've looked in the most obvious
one. The one called "Ribbon", but at the time the NewInspector event
triggers
I only see one control listed under that collection. Are they added after
the
NewInspector event? If so, when is the ideal time to look for them?

John



John Erickson[_2_] August 28th 09 02:19 AM

Ribbon question
 
Is there one document that I can download that describes all the idMso
commands in the Outlook ribbons or is there a utility like Spy for Ribbons?

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

The ribbon controls are not in the CommandBars collection. You need to use
the XML schema for Outlook to know what XML to write for your ribbon
controls and to handle built-in controls in the ribbon. You then set up
callbacks for the things exposed by the schema and make all of your
customizations that way.

You can download the ribbon schemas from the Office developer Web site.
There are also samples there for how to use the ribbon.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"John Erickson" wrote in message
...
Hi,

I'm trying to repurpose some of the controls on the mail inspector ribbon.
Are the ribbon controls available in the Office::_CommandBars collection?
If
so, under which control are they located? I've looked in the most obvious
one. The one called "Ribbon", but at the time the NewInspector event
triggers
I only see one control listed under that collection. Are they added after
the
NewInspector event? If so, when is the ideal time to look for them?

John




Ken Slovak - [MVP - Outlook] August 28th 09 02:25 PM

Ribbon question
 
The ribbon schemas is a zip that has general docs on the overall ribbon
schema, then there are individual docs for each Office application's schemas
and individual ones for each Outlook item type. Everything isn't in just one
doc.

One way to get an idMso for a built-in ribbon control is to go to the
customize dialog for the QAT. In there if you hover over a control the idMso
will be displayed. I do that every so often in one-off situations, but I
find it more efficient when I'm composing a complete ribbon XML to work with
the separate docs.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"John Erickson" wrote in message
...
Is there one document that I can download that describes all the idMso
commands in the Outlook ribbons or is there a utility like Spy for
Ribbons?



John Erickson[_2_] August 28th 09 07:43 PM

Ribbon question
 
Thanks Ken! I was able to use the hover technique to get the idMso values
that I need to repurpose. I think I am having issues with the xml format
though. I wish IRibbonExtensibility::GetCustomUI was designed differently so
that it was able to return an error code on poorly formatted xml and give me
some clues as to what's wrong. Since this is only my second attempt at
submitting xml for this call (Jenson Harris' example in using RibbonX with
C++ and ATL being my first), perhaps you can take a quick look at the xml I'm
providing and tell me what I'm doing wrong. The reason I think I'm having XML
issues is that I never see a call to my IDispatch::GetIDsOfNames when I click
the appropriate button. Here's the XML I'm returning:

customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
ribbon
commands
command idMso="JunkEmailAddToBlockedSendersList" onAction="OnABSL"
command idMso="JunkEmailAddToSafeSendersList" onAction="OnASSL"
command idMso="JunkEmailAddToSafeDomainList" onAction="OnASDL"
command idMso="JunkEmailOptions" onAction="OnOptions"
command idMso="JunkEmailMarkAsNotJunk" onAction="OnMarkAsNotJunk"
/commands
/ribbon
/customUI

John

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

The ribbon schemas is a zip that has general docs on the overall ribbon
schema, then there are individual docs for each Office application's schemas
and individual ones for each Outlook item type. Everything isn't in just one
doc.

One way to get an idMso for a built-in ribbon control is to go to the
customize dialog for the QAT. In there if you hover over a control the idMso
will be displayed. I do that every so often in one-off situations, but I
find it more efficient when I'm composing a complete ribbon XML to work with
the separate docs.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"John Erickson" wrote in message
...
Is there one document that I can download that describes all the idMso
commands in the Outlook ribbons or is there a utility like Spy for
Ribbons?




Ken Slovak - [MVP - Outlook] August 28th 09 10:21 PM

Ribbon question
 
There is a setting in the Tools, Options advanced tab to show UI ribbon
errors that can sometimes be helpful, at least to localizing the error to
the XML line.

I'd have to get back to you on your repurposing XML, I only played with that
a little and it was a few years ago.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"John Erickson" wrote in message
...
Thanks Ken! I was able to use the hover technique to get the idMso values
that I need to repurpose. I think I am having issues with the xml format
though. I wish IRibbonExtensibility::GetCustomUI was designed differently
so
that it was able to return an error code on poorly formatted xml and give
me
some clues as to what's wrong. Since this is only my second attempt at
submitting xml for this call (Jenson Harris' example in using RibbonX with
C++ and ATL being my first), perhaps you can take a quick look at the xml
I'm
providing and tell me what I'm doing wrong. The reason I think I'm having
XML
issues is that I never see a call to my IDispatch::GetIDsOfNames when I
click
the appropriate button. Here's the XML I'm returning:

customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
ribbon
commands
command idMso="JunkEmailAddToBlockedSendersList" onAction="OnABSL"
command idMso="JunkEmailAddToSafeSendersList" onAction="OnASSL"
command idMso="JunkEmailAddToSafeDomainList" onAction="OnASDL"
command idMso="JunkEmailOptions" onAction="OnOptions"
command idMso="JunkEmailMarkAsNotJunk" onAction="OnMarkAsNotJunk"
/commands
/ribbon
/customUI

John



John Erickson[_2_] August 28th 09 11:17 PM

Ribbon question
 
Thanks again Ken. That allowed me to track down the problems. I had to
eliminate the ribbon tags and terminate the command tags with a \. After
that it worked great.

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

There is a setting in the Tools, Options advanced tab to show UI ribbon
errors that can sometimes be helpful, at least to localizing the error to
the XML line.

I'd have to get back to you on your repurposing XML, I only played with that
a little and it was a few years ago.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"John Erickson" wrote in message
...
Thanks Ken! I was able to use the hover technique to get the idMso values
that I need to repurpose. I think I am having issues with the xml format
though. I wish IRibbonExtensibility::GetCustomUI was designed differently
so
that it was able to return an error code on poorly formatted xml and give
me
some clues as to what's wrong. Since this is only my second attempt at
submitting xml for this call (Jenson Harris' example in using RibbonX with
C++ and ATL being my first), perhaps you can take a quick look at the xml
I'm
providing and tell me what I'm doing wrong. The reason I think I'm having
XML
issues is that I never see a call to my IDispatch::GetIDsOfNames when I
click
the appropriate button. Here's the XML I'm returning:

customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
ribbon
commands
command idMso="JunkEmailAddToBlockedSendersList" onAction="OnABSL"
command idMso="JunkEmailAddToSafeSendersList" onAction="OnASSL"
command idMso="JunkEmailAddToSafeDomainList" onAction="OnASDL"
command idMso="JunkEmailOptions" onAction="OnOptions"
command idMso="JunkEmailMarkAsNotJunk" onAction="OnMarkAsNotJunk"
/commands
/ribbon
/customUI

John





All times are GMT +1. The time now is 12:26 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com