Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / July 2007

Tip: Looking for answers? Try searching our database.

Insert Ribbon buttons into QuickAccessToolbar problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christian Havel - 09 Jul 2007 09:38 GMT
Hi,

with the following code I try to insert buttons into the QuickAccessToolbar,
which does not work.

   Dim strDescription As String
   strDescription = "<customUI
xmlns=""http://schemas.microsoft.com/office/2006/01/customui""
loadImage=""LoadImage"">"
       strDescription = strDescription & _
         "<ribbon>" & _
           "<quat>" & _
               "<documentControls>" & _
                 "<button id=""IDS_WaehlenCombo"" label=""" &
GetCheckedResString(IDS_WaehlenCombo) & """ onAction=""cmdCommonRibbonBttn""
getImage=""GetImage"" />" & _
                 "<button id=""IDS_Auflegen"" label=""" &
GetCheckedResString(IDS_Auflegen) & """ onAction=""cmdCommonRibbonBttn""
getImage=""GetImage"" />" & _
                 "<button id=""IDS_Aktionen"" label=""" &
GetCheckedResString(IDS_Aktionen) & """ onAction=""cmdCommonRibbonBttn""
getImage=""GetImage""/>" & _
               "</documentControls>" & _
           "</quat>" & _
         "</ribbon>" & _
       "</customUI>"

Does anybody see my failure?
Christian
Ken Slovak - [MVP - Outlook] - 09 Jul 2007 14:31 GMT
For one thing you have to use the correct name and tie it to an idMso, plus
you need the <tabs> and <tab> tags there just as if you were working with
any other ribbon:

<ribbon>
   <tabs>
       <tab idMso="Quick Access Toolbar">

You also should be aware that any QAT modifications you make will only apply
to the QAT for that ribbon. If you customize the QAT for Outlook.Mail.Read
it won't apply to Outlook.Mail.Compose or any other ribbon. You'll need to
apply your QAT customizations to every ribbon where you want the
customizations to appear.

Signature

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

> Hi,
>
[quoted text clipped - 27 lines]
> Does anybody see my failure?
> Christian
Christian Havel - 09 Jul 2007 15:10 GMT
Hi Ken,

I tried it with the two following Ribbon descriptions. I receive the error
message:

Failure in analysing from "Quick Access Toolbar" as NCName-datatype.
Failure in analysing from attribut "idMso" with the value "Quick Access
Toolbar"

(It is translated from german)

1.) Ribbon desription:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
loadImage="LoadImage"><ribbon><tabs><tab idMso="Quick Access Toolbar" ><group
id="c4bBrand" label="XPhone"><button id="IDS_WaehlenCombo" label="Wählen"
onAction="cmdCommonRibbonBttn" getImage="GetImage" /><button
id="IDS_Auflegen" label="Auflegen" onAction="cmdCommonRibbonBttn"
getImage="GetImage" /><button id="IDS_Aktionen" label="Aktionen"
onAction="cmdCommonRibbonBttn"
getImage="GetImage"/></group></tab></tabs></ribbon></customUI>

2.) Ribbon description:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
loadImage="LoadImage"><ribbon><tabs><tab idMso="Quick Access Toolbar"
><button id="IDS_WaehlenCombo" label="Wählen" onAction="cmdCommonRibbonBttn"
getImage="GetImage" /><button id="IDS_Auflegen" label="Auflegen"
onAction="cmdCommonRibbonBttn" getImage="GetImage" /><button
id="IDS_Aktionen" label="Aktionen" onAction="cmdCommonRibbonBttn"
getImage="GetImage"/></tab></tabs></ribbon></customUI>

> For one thing you have to use the correct name and tie it to an idMso, plus
> you need the <tabs> and <tab> tags there just as if you were working with
[quoted text clipped - 41 lines]
> > Does anybody see my failure?
> > Christian
Ken Slovak - [MVP - Outlook] - 09 Jul 2007 18:28 GMT
Hmm. It's documented as "Quick Access Toolbar" but you might need to use
"qat" despite the documentation. See if it works if you use the idMso =
"qat".

Signature

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

> Hi Ken,
>
[quoted text clipped - 27 lines]
> id="IDS_Aktionen" label="Aktionen" onAction="cmdCommonRibbonBttn"
> getImage="GetImage"/></tab></tabs></ribbon></customUI>
Christian Havel - 10 Jul 2007 08:10 GMT
Hi Ken,

I tried it with the following code:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
loadImage="LoadImage"><ribbon><tabs><tab idMso="quat" ><button
id="IDS_WaehlenCombo" label="Wählen" onAction="cmdCommonRibbonBttn"
getImage="GetImage" /><button id="IDS_Auflegen" label="Auflegen"
onAction="cmdCommonRibbonBttn" getImage="GetImage" /><button
id="IDS_Aktionen" label="Aktionen" onAction="cmdCommonRibbonBttn"
getImage="GetImage"/></tab></tabs></ribbon></customUI>

and received the following error message (translated from german):

Errorcode: 0x80004005
Element '{http://schemas.microsoft.com/office/2006/01/customui}button' is
corresponding to the "Inhaltsmodell" from the higher element
'{http://schemas.microsoft.com/office/2006/01/customui}tab' unexpected

Christian

> Hmm. It's documented as "Quick Access Toolbar" but you might need to use
> "qat" despite the documentation. See if it works if you use the idMso =
[quoted text clipped - 31 lines]
> > id="IDS_Aktionen" label="Aktionen" onAction="cmdCommonRibbonBttn"
> > getImage="GetImage"/></tab></tabs></ribbon></customUI>
Ken Slovak - [MVP - Outlook] - 10 Jul 2007 14:47 GMT
Is it better if you change:

   <tab idMso="quat" >

to

   <tab idMso="qat" >  ?

Signature

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

> Hi Ken,
>
[quoted text clipped - 16 lines]
>
> Christian
Christian Havel - 10 Jul 2007 15:10 GMT
Hi Ken,

with the following code I tried it:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
loadImage="LoadImage"><ribbon><tabs><tab idMso="qat" ><button
id="IDS_WaehlenCombo" label="Wählen" onAction="cmdCommonRibbonBttn"
getImage="GetImage" /><button id="IDS_Auflegen" label="Auflegen"
onAction="cmdCommonRibbonBttn" getImage="GetImage" /><button
id="IDS_Aktionen" label="Aktionen" onAction="cmdCommonRibbonBttn"
getImage="GetImage"/></tab></tabs></ribbon></customUI>

Outlook says that there are some problems with the button in the tab. ????
Christian

> Is it better if you change:
>
[quoted text clipped - 24 lines]
> >
> > Christian
Ken Slovak - [MVP - Outlook] - 10 Jul 2007 19:59 GMT
Now I'm guessing (I haven't worked with the QAT myself in code) but it's
possible you can only modify the QAT in code if you use the
<startfromscratch> setting, which would mean that you have to construct
everything from scratch.

Signature

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

> Hi Ken,
>
[quoted text clipped - 10 lines]
> Outlook says that there are some problems with the button in the tab. ????
> Christian
Patrick Schmid [MVP] - 30 Jul 2007 21:39 GMT
The QAT is modified a bit differently. If you look at the XML hierarchy,
it actually goes like this:
<customUI>
    <ribbon>
        <qat>
            <sharedControls>
            <documentControls>
        <tabs>
        <contextualTabs>
So you have to put your buttons in either the sharedControls or
documentControls section. I'd advise sharedControls always, as the other
one is not useful in Outlook.
The big catch though is that any QAT modifications are only applied if
you use startFromScratch="true" in the ribbon element. For most add-ins
this means that you have to stay away from the QAT. This is intentional,
as the QAT is supposed to be the user's space. If a user wants a
particular add-in's button on the QAT, he or she can add them her or
himself.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://ribboncustomizer.com
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

> Now I'm guessing (I haven't worked with the QAT myself in code) but it's
> possible you can only modify the QAT in code if you use the
[quoted text clipped - 23 lines]
> > Outlook says that there are some problems with the button in the tab. ????
> > Christian
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.