English 中文(简体)
Add custom group to Home tab in Outlook 2010 using VBA
原标题:

Can t seem to find any simple VBA tutorials for adding a custom group to the Home tab in the Outlook 2010 ribbon.

Shouldn t it be a couple of simple steps involving something like traversing objects in the Home tab and programmatically add the group with controls etc, or redefine the XML that describes the Home tab.

Is there any sample VBA code or articles that have this simple example? Specifically I m trying to add a custom group with 1 text field and 1 button that fires a custom macro.

Cheers, Dave --Trindaz on Fedang #outlook-2010-vba

问题回答

I wasn t able to get any VBA working for this, but I was able to...

  1. Create a new Outlook 2007 project type in Visual Studio 2008
  2. Add a new Ribbon (XML) item to the project
  3. Follow the instructions in the sample code in the newly created Ribbon1.vb
  4. Make sure the <tab> element in Ribbon1.xml has property idMso="TabMail"
  5. Publish and run the installer application to get the new items appearing in the Home tab of the Outlook ribbon

Done!

Another answer using Ribbon XML for Outlook 2010:

 <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabMail">
        <group id="Group0"  label="my Group" insertBeforeMso="GroupMoveActions">
          <button id="myButton"
              size="large"
              label="someLabel"
              screentip="A tip to read..."
              supertip="Some super tip..."
              />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

You can also download this file: Office 2010 Help Files which contains the IDs of the Outlook controls. Once installed, look for the file OutlookExplorerControls.xlsx, this file contains the names of the groups you can use for the property insertBeforeMso.





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签