Add new button in "Save & Send"

Add-in Express™ Support Service
That's what is more important than anything else

Add new button in "Save & Send"
 
Simon Murrell




Posts: 4
Joined: 2010-07-05
Hello

How do I add a button into Office 2010 so it shows up
below the "Save to SharePoint" link in the Office apps?

Regards,
Simon
Posted 05 Jul, 2010 06:24:45 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hi Simon,

As far as I understand, you cannot show a button on this level because that level accepts tasks in Ribbon terms or components of the ADXBackstageTaskFormGroupTask type in Add-in Express terms.

Below is the code that adds a custom task below the Save To SharePoint task.

private AddinExpress.MSO.ADXBackstageView adxBackstageView1;
private AddinExpress.MSO.ADXBackstageTab adxBackstageTab1;
private AddinExpress.MSO.ADXBackstageTaskFormGroup adxBackstageTaskFormGroup1;
private AddinExpress.MSO.ADXBackstageTaskFormGroupCategory adxBackstageTaskFormGroupCategory1;
private AddinExpress.MSO.ADXBackstageTaskFormGroupTask adxBackstageTaskFormGroupTask1;
private AddinExpress.MSO.ADXBackstageGroup adxBackstageGroup1;
private AddinExpress.MSO.ADXBackstageGroupButton adxBackstageGroupButton1;

...

private void InitializeComponent()
{
    this.components = new System.ComponentModel.Container();
    this.adxBackstageView1 = new AddinExpress.MSO.ADXBackstageView(this.components);
    this.adxBackstageTab1 = new AddinExpress.MSO.ADXBackstageTab(this.components);
    this.adxBackstageTaskFormGroup1 = new AddinExpress.MSO.ADXBackstageTaskFormGroup(this.components);
    this.adxBackstageTaskFormGroupCategory1 = new AddinExpress.MSO.ADXBackstageTaskFormGroupCategory(this.components);
    this.adxBackstageTaskFormGroupTask1 = new AddinExpress.MSO.ADXBackstageTaskFormGroupTask(this.components);
    this.adxBackstageGroup1 = new AddinExpress.MSO.ADXBackstageGroup(this.components);
    this.adxBackstageGroupButton1 = new AddinExpress.MSO.ADXBackstageGroupButton(this.components);
    // 
    // adxBackstageView1
    // 
    this.adxBackstageView1.Controls.Add(this.adxBackstageTab1);
    this.adxBackstageView1.Id = "adxBackstageView_138018032545425ca30c9ed188278bb7";
    this.adxBackstageView1.Ribbons = AddinExpress.MSO.ADXRibbons.msrExcelWorkbook;
    // 
    // adxBackstageTab1
    // 
    this.adxBackstageTab1.FirstColumn.Add(this.adxBackstageTaskFormGroup1);
    this.adxBackstageTab1.Id = "adxBackstageTab_162de75c1c7a4284a8cffeb1da61493f";
    this.adxBackstageTab1.IdMso = "TabShare";
    this.adxBackstageTab1.Ribbons = AddinExpress.MSO.ADXRibbons.msrExcelWorkbook;
    // 
    // adxBackstageTaskFormGroup1
    // 
    this.adxBackstageTaskFormGroup1.AllowedTaskSizes = ((AddinExpress.MSO.ADXBackstageAllowedTaskSizes)((AddinExpress.MSO.ADXBackstageAllowedTaskSizes.Small | AddinExpress.MSO.ADXBackstageAllowedTaskSizes.Medium)));
    this.adxBackstageTaskFormGroup1.Controls.Add(this.adxBackstageTaskFormGroupCategory1);
    this.adxBackstageTaskFormGroup1.Id = "adxBackstageTaskFormGroup_1c68ae148bb84a9db638502c488191c7";
    this.adxBackstageTaskFormGroup1.IdMso = "GroupShare";
    this.adxBackstageTaskFormGroup1.Ribbons = AddinExpress.MSO.ADXRibbons.msrExcelWorkbook;
    this.adxBackstageTaskFormGroup1.ShowCaption = false;
    // 
    // adxBackstageTaskFormGroupCategory1
    // 
    this.adxBackstageTaskFormGroupCategory1.Controls.Add(this.adxBackstageTaskFormGroupTask1);
    this.adxBackstageTaskFormGroupCategory1.Id = "adxBackstageTaskFormGroupCategory_15e9ae82e1264da8866a5170da4a77f5";
    this.adxBackstageTaskFormGroupCategory1.IdMso = "Share";
    this.adxBackstageTaskFormGroupCategory1.Ribbons = AddinExpress.MSO.ADXRibbons.msrExcelWorkbook;
    // 
    // adxBackstageTaskFormGroupTask1
    // 
    this.adxBackstageTaskFormGroupTask1.Caption = "adxBackstageTaskFormGroupTask1";
    this.adxBackstageTaskFormGroupTask1.Controls.Add(this.adxBackstageGroup1);
    this.adxBackstageTaskFormGroupTask1.Id = "adxBackstageTaskFormGroupTask_d412f1e60c7745bfb1d9fb4ee16c97e9";
    this.adxBackstageTaskFormGroupTask1.ImageTransparentColor = System.Drawing.Color.Transparent;
    this.adxBackstageTaskFormGroupTask1.InsertAfterIdMso = "FileSaveToSharePoint";
    this.adxBackstageTaskFormGroupTask1.Ribbons = AddinExpress.MSO.ADXRibbons.msrExcelWorkbook;
    // 
    // adxBackstageGroup1
    // 
    this.adxBackstageGroup1.Caption = "My Group";
    this.adxBackstageGroup1.Id = "adxBackstageGroup_c55646ec324c42d1adb758d24596fbe0";
    this.adxBackstageGroup1.Ribbons = AddinExpress.MSO.ADXRibbons.msrExcelWorkbook;
    this.adxBackstageGroup1.TopItems.Add(this.adxBackstageGroupButton1);
    // 
    // adxBackstageGroupButton1
    // 
    this.adxBackstageGroupButton1.Caption = "adxBackstageGroupButton1";
    this.adxBackstageGroupButton1.Id = "adxBackstageGroupButton_afdf34df9f91425c915ee725a5bc69ba";
    this.adxBackstageGroupButton1.ImageTransparentColor = System.Drawing.Color.Transparent;
    this.adxBackstageGroupButton1.Ribbons = AddinExpress.MSO.ADXRibbons.msrExcelWorkbook;
    // 
    // AddinModule
    // 
    this.AddinName = "MyAddin213";
    this.SupportedApps = AddinExpress.MSO.ADXOfficeHostApp.ohaExcel;

}



Andrei Smolin
Add-in Express Team Leader
Posted 05 Jul, 2010 11:27:06 Top
Simon Murrell




Posts: 4
Joined: 2010-07-05
Would this also work the same in Office 2007?
Posted 05 Jul, 2010 14:41:20 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hi Simon,

No, it wouldn't. There's no Backstage View in Office 2007. To customize the Office Button Menu in Office 2007, you need to add an ADXRibbonOfficeMenu component onto the add-in module.

Positioning Ribbon Controls

Every Ribbon component provides the InsertBeforeId, InsertBeforeIdMso and InsertAfterId, InsertAfterIdMso properties. You use the InsertBeforeId and InsertAfterId properties to position the control among other controls created by your add-in, just specify the Id of the corresponding Ribbon components in any of these properties. The InsertBeforeIdMso and InsertAfterIdMso properties allow positioning the control among built-in Ribbon controls.

All built-in Ribbon controls are identified by their IDs. Pay attention, the ID of a built-in Ribbon control is a string, not integer. All such IDs are available for download on the Microsoft web site, for Office 2007, see http://www.microsoft.com/downloads/details.aspx?FamilyID=4329d9e9-4d11-46a5-898d-23e4f331e9ae&DisplayLang=en; for Office 2010, see http://www.microsoft.com/downloads/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en page. The download installs Excel files; the Control Name column of each contains the IDs of almost all built-in Ribbon controls for the corresponding Ribbon.



Andrei Smolin
Add-in Express Team Leader
Posted 06 Jul, 2010 02:49:00 Top