Failed to find Office control by ID

R

regify

Hi,

I add an additional group to the existing New-Mail tab in Outlook 2007
using this XML:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="OnLoad">
<ribbon>
<tabs>
<tab idMso="TabNewMailMessage">
<group id="grpRegifyCompose" label="regify®" visible ="1">
<button id="SendRegify"
getLabel="GetLabel"
getScreentip="GetToolTip"
onAction="regifyHandler"
getImage="GetImage" size="normal"
getEnabled="GetEnabled"
/>
<button id="ConfigRegify"
getLabel="GetLabel"
getScreentip="GetToolTip"
onAction="regifyHandler"
getImage="GetImage" size="normal"
getEnabled="GetEnabled"
/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>

Everything works fine until the day, a customer sent me this error-
report:

While trying to open an attached file (PDF or DOC for example), the
addin fails with this error:

Errorcode: 0x80004005
Failed to find Office control by ID
ID: TabNewMailMessage

I wonder, how to prevent this error? Any idea what happened? I can't
see any error here on my test-systems.

Help me please, the customer is very important to me.

Volker
 
K

Ken Slovak - [MVP - Outlook]

"TabNewMailMessage" is valid of course.

Did the same addin ever run correctly on that user's computer? He is using
Outlook 2007, correct?

Does any other UI you create work correctly? Is the problem only with this
one piece of Ribbon UI?

Have you asked the customer to tick the setting to display UI errors, that
might be helpful in troubleshooting the problem. In Outlook 2007 select
Tools, Options, Other tab, Advanced Options button. In the Advanced Options
dialog they should check "Show add-in user interface errors", then OK their
way out of the Options dialog.

If the addin used to run correctly on that computer try to find out from
your customer what changed recently. For example, any new software that was
installed or updates to existing software might provide a clue.




Hi,

I add an additional group to the existing New-Mail tab in Outlook 2007
using this XML:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="OnLoad">
<ribbon>
<tabs>
<tab idMso="TabNewMailMessage">
<group id="grpRegifyCompose" label="regify®" visible ="1">
<button id="SendRegify"
getLabel="GetLabel"
getScreentip="GetToolTip"
onAction="regifyHandler"
getImage="GetImage" size="normal"
getEnabled="GetEnabled"
/>
<button id="ConfigRegify"
getLabel="GetLabel"
getScreentip="GetToolTip"
onAction="regifyHandler"
getImage="GetImage" size="normal"
getEnabled="GetEnabled"
/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>

Everything works fine until the day, a customer sent me this error-
report:

While trying to open an attached file (PDF or DOC for example), the
addin fails with this error:

Errorcode: 0x80004005
Failed to find Office control by ID
ID: TabNewMailMessage

I wonder, how to prevent this error? Any idea what happened? I can't
see any error here on my test-systems.

Help me please, the customer is very important to me.

Volker
 
R

regify

Hi Ken,
Did the same addin ever run correctly on that user's computer? He is using
Outlook 2007, correct?
Yes.

Does any other UI you create work correctly? Is the problem only with this
one piece of Ribbon UI?

I found the option you mentioned and yes, the error occurs to me, too.
But if I disable this option, the complete AddIn works fine. Any Idea
how to prevent such a behaviour? Is there an error in this XML? I
agree, that the error occurs in dialogs, that are not showing
TabNewMailMessage. But how do I tell outlook, not trying to find
TabNewMailMessage in other dialogs, but only the real NewMessage
dialog? Did I miss something?

Volker
 
K

Ken Slovak - [MVP - Outlook]

Are you returning the same XML no matter what type of item is called for in
your GetCustomUI() callback? You would only supply that XML for example if a
new compose email was requesting ribbon XML.

In GetCustomUI() you get string RibbonID passed to you, which is the type of
item requesting ribbon XML. If you don't want to create a ribbon for that
type of item you supply a null string as the return value. So, for only new
email items (where TabNewMailMessage applies) the code would look something
like this:

switch (RibbonID)
{
case "Microsoft.Outlook.Mail.Compose":
return ribbonXML; // this is your custom XML as a string
break;
default:
return "";
break;
}

The XML documentation for the ribbon lists all the types of Outlook ribbon
items and the RibbonID you get passed. For example for a sent message that
you open RibbonID == "Microsoft.Outlook.Mail.Read". In that case the same
tab would have a name of "TabReadMessage" and not "TabNewMailMessage".
 
R

regify

Hi Ken,
In GetCustomUI() you get string RibbonID passed to you, which is the type of
item requesting ribbon XML. If you don't want to create a ribbon for that
type of item you supply a null string as the return value. So, for only new
email items (where TabNewMailMessage applies) the code would look something
like this:

Thank you very much! This solved my problem and now it works like a
charm. I only set the XML that is needed for this special dialog. I
thought that outlook ignores information for tabs that are currently
not displayed. That was wrong...

Thank you again!

Volker
 

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