English 中文(简体)
Adding a Tab to the Outlook 2010 Ribbon?
原标题:

I m trying to create an Outlook 2010 addin that adds a new tab to the ribbon. I found out how I can add my groups to an existing tab by setting the OfficeId to "TabMail" or something built-in, but I don t want to modify existing tabs.

I ve now set the OfficeId that something of my own ("TabMyAddin"), but it doesn t show up in Outlook. I wonder if I need to somehow tell Outlook to add it and show it, or how I would proceed?

The RibbonType was changed to Microsoft.Outlook.Explorer if that matters.

最佳回答

Okay, got it:

  • In the Visual Ribbon Designer, the ControlId property needs to be set to "Custom" instead of Office. When set to Office, it will set idMso to the given OfficeId and when set to Custom, it will instead set the id.
  • In the XML Ribbon Designer, the <tab> needs to have an id instead of an idMso.
问题回答

The only way that I can get it to work is by setting the ControlID to custom and changing the RibbonType to Microsoft.Outlook.Explorer.

you can add tab in outlook, just using following steps :

1) Go to project and click on add item.

2) you will see following screenenter image description here

3) paste following code in thisAddin.cs file

 protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()

 {
  return new Ribbon1();
 }

4) Open the Ribbon1.xml file . You will see ribbon tab control code. you can change tab name , group name in xml under ribbon node

<tabs>
  <tab idMso="TabAddIns" label="tab name">  // your tab name
    <group id="MyGroup"
           label="My Group">
    </group>
  </tab>
</tabs>




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签