Code Monkey home page Code Monkey logo

office-add-in-commands's Introduction

[Moved] Office Add-in Commands Samples

This sample moved to the Office Add-in samples repo

Note: This repo is archived and no longer actively maintained. Security vulnerabilities may exist in the project, or its dependencies. If you plan to reuse or run any code from this repo, be sure to perform appropriate security checks on the code or dependencies first. Do not use this project as the starting point of a production Office Add-in. Always start your production code by using the Office/SharePoint development workload in Visual Studio, or the Yeoman generator for Office Add-ins, and follow security best practices as you develop the add-in.

Overview

Add-in commands enable developers to extend the Office user interface such as the Office Ribbon to create awesome, efficient to use add-ins. Watch this channel9 video for a complete overview. The examples in this repo show you how to use add-in commands in Excel, Word and PowerPoint add-ins. If you are looking for information about commands for Outlook head to http://dev.outlook.com

Here is how the samples look when running:

Custom Tab (Simple Example)

Excel

Word

Existing Tab

PowerPoint

Quick Start

Step 1. Setup your environment

  • Office Desktop: Ensure that you have the latest version of Office installed. Add-in commands require build 16.0.6769.0000 or higher (16.0.6868.0000 recommended). Learn how to Install the latest version of Office applications.

  • Office Online: There is no additional setup. Please note that support for commands in Office Online for work/school accounts is in preview.

  • Office for Mac: Ensure that you have build 15.33+

Step 2. Create and validate your manifest

We strongly recommend you to use one of our sample manifests as a starting point, the Simple example is a good one to get going. Once you make it work then you can start making small modifications and test your changes often. If you make modifications, use the Manifest reference as a guide. You can also validate your xml using the Office Add-in Validator **. For Office Windows clients you can also use Runtime Logging to debug your manifest.

You can also use the latest Visual Studio Tools to create and debug your add-in. See next step.

Step 3. Deploy add-in manifest and test the add-in

To test your add-in you must register it with Office. Two methods are currently supported:

Sideload directly to the client

  • Office Desktop. Sideload your add-in via a network share.

    • Once sideloaded, go to Insert>My Add-ins>Shared Folder and click the Refresh button to ensure the Add-in shows. Do this any time you need to refresh your Ribbon.
  • Office Online. Open the Add-ins dialog via Insert>Office Add-ins then select [Manage My Add-ins]>Upload My Add-in and upload the manifest file you want to test. To remove a sideloaded add-in you have to clear your HTML LocalStorage

  • Office for Mac. Sideload your add-in on the Mac

    • Once sideloaded, goto Insert>Office Add-ins and click on the add-in to install it.

Visual Studio F5

  • Make sure you have at least version 16.0.6868.0000 of Office for Windows installed.
  • Make sure you have the latest Visual Studio tools.

Once you have the latest, the new VS templates include support for add-in commands. You can also deploy your add-ins to Windows Desktop clients using F5.

Documentation

Join the Microsoft 365 Developer Program

Get a free sandbox, tools, and other resources you need to build solutions for the Microsoft 365 platform.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

office-add-in-commands's People

Contributors

cf256 avatar davidchesnut avatar dbroussa avatar elizabethsamuel-msft avatar lauragra avatar lezamax avatar lindalu-msft avatar o365devx avatar panjkov avatar rick-kirkham avatar ruoyingliang avatar shakosteve avatar stewartadam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

office-add-in-commands's Issues

Commands in Project

Hi,

I am trying to develop an add-in for Project, specifically a Command (I want a custom group in the toolbar with some buttons), but I am a bit unsure if that is actually possible or not. I got the task panel to work, but I have not found a way to get commands to work. Is this possible in Project?

One CommandBar for multiple hosts

When looking at the VersionOverrides Hosts - I suppose that I have to repeat myself, when using the same commands for excel, word, etc.
Or is there a chance to define a command set for multiple clients.
@LezaMax

Sample manifests don't pass validation

I'm trying to understand the deployment of add ins, but the samples don't seem to be working. I grabbed the Excel sample manifest, replaced the ID with one generated by Visual Studio, saved as an .xml file and ran validate-office-addin on it. The first error was a missing support URL:

> validate-office-addin .\sample_manifest.xml
Calling validation service. This might take a moment...
-------------------------------------
Validation: Failed

Error #1:
Missing Support URL: The manifest support URL could not be found. (link: https://aka.ms/oacksupporturl)
-------------------------------------

I copied the SupportURL element from this page, ran the validator again and got this error:

> validate-office-addin .\sample_manifest.xml
Calling validation service. This might take a moment...
-------------------------------------
Validation: Failed

Error #1:
XML Schema Violation: Your manifest does not adhere to the current set of XML schema definitions for Office Add-in manifests. (link: https://aka.ms/add-in-manifest-schema-violation)
  - Details: The element 'OfficeApp' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1' has invalid child element 'IconUrl' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1'. List of possible elements expected: 'AppDomains, Hosts, Requirements, DefaultSettings' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1'.
  - Line: 17
  - Column: 4
-------------------------------------

Deleted the IconURL tag and got this:

> validate-office-addin .\sample_manifest.xml
Calling validation service. This might take a moment...
-------------------------------------
Validation: Failed

Error #1:
Manifest Icon Element Missing: An icon element could not be found. Please see https://aka.ms/oackicon for details. (link: https://aka.ms/oackicon)
-------------------------------------

The documentation for IconURL didn't help much, as it doesn't specify the parent tag.

I had the exact same problems with the simple add in manifest.

Are these code samples outdated? If not, why aren't they working? I'd imagine the simplest code sample from Microsoft themselves would at least pass validation.

Forgot to add, I'm on Windows 10, developing for Office365 Business. I couldn't find the version of validate-office-addin because it doesn't have -v or --version flags, and -h only lists -h as possible flag.

Office add-in caching data

Hi,

I have created an add-in, which loads some dynamic data when loaded. It works well in outlook web, but unfortunately has issues with the outlook desktop client. The desktop client is caching data, hence the new and updated content is not being shown in the add-in when loaded.
Is there a rule/permission/key I can set in the manifest which restricts caching?

Possibility to add standard Word buttons

Would be great if we could add standard Word buttons on our custom tabs.
It is possible to add it manually through Ribbon And Toolbar menu, but not directly through our manifest.

Thanks,
Igor

Outlook samples?

Add-in commands are definitely supported in Outlook based on parts of the documentation, so it would be great to hav some Outlook-specific examples in this repo.

SimpleAddin.xml does not load Ribbon in Excel for Mac

Hi,

I wanted to start building an Add-In for Excel but the sample does not load the Ribbon in Microsoft Excel for Mac Version 15.23.2 (160624). The Task-Pane is showing but not the ribbon.

In Excel Online, it works fine.

I have confirmed this issue on two separate machines.

It would be super nice to have this working as I want to build a custom ribbon for my Add-In. Thanks!

PS: I had initially stated that it was not working in Excel Online as well. This was because I had forgotten (for the second time) to change the two instances of Document to Workbook. My problem with the ribbon not showing in the local installation remains.

Argument of type '{ cells: { row: number; column: number; }; format: { backgroundColor: string; }; }' is not assignable to parameter of type '{ cells: { row: number; }; format: { backgroundColor: string; }; }'

I'm using Visual Studio 2015 Update 1 (TypeScript 1.7.4.0) and getting an error when compiling the Excel demo

Severity Code Description Project File Line Suppression State
Error Build: Argument of type '{ cells: { row: number; column: number; }; format: { backgroundColor: string; }; }' is not assignable to parameter of type '{ cells: { row: number; }; format: { backgroundColor: string; }; }'. ODSampleDataWeb C:\git\Office-Add-in-Commands-Samples\Excel\Webapp\ODSampleDataWeb\Scripts\App\Record.ts 157

MsProject

Is possible, make a Button for open my Addin, over MsProject 2019 ? (Office Desktop , Build 14026.20246)

with Windows 10, the Registery setting is not working!

I have recently upgraded my OS to windows 10. before this i was using windows 7, and i download the registry setting and was able to see the ribbon control in my office 2016.

now even after updating the Registry with windows 10. Not able to see the ribbon control in my word

Incorrect manifest file

In my current project I'm trying to add a custom tab by taking XML changes from Simple/Manifest directory, I verified the changed manifest using npm run validate
And the log said it was correct.

But when I try to sideload this modified XML, the web app for MS word, I'm unable to sideload as the web app says that manifest is invalid.

How do I debug this?

Add support for Angular or a sample that works calling into an Angular app function

Commands are great and I'm using them in my Add-Ins but I can't figure a way to call "into" an Angular app via the function file or have the Angular app be the function file. So all I can do is use one command icon on the ribbon that just launches the app. This is OK but I have several places in my add-in where it makes sense to invoke an action that could be map to either a ribbon button or the context menu that works integrates with the state I have running in the add-in.

If you have any examples or plan some support in the future that would be great. (BTW, the same is true of the Dialog API -- it has to call a URL on the server and there is no way to pass info to it from an Angular app already on the client unless I post back with all the data I want the dialog to show).

More details of what I have tried...

  • if I point the URL of the function file to my main angular entry page "app.html" (or .aspx) it won't work; I tried adding a unique URL param to try and get the entire add-in to reload in the Task Pane with a diffn context and load the angular app with a different function entry point but the call does not reload the add-in like Outlook Add-in's do. Having to reload the entire add-in is not ideal anyway as I just want to call a method on some angular service/object.
  • if I create a separate function file (i.e. not app.html) with the same angular app code it doesn't work either since this is a different instance of the angular app (and a diffn DOM) and can't interact with the app.html angular app

cannot install latest build based on instructions here

I'm trying to follow this:
https://github.com/OfficeDev/Office-Add-in-Commands-Samples/blob/master/Tools/LatestOfficeBuild.md
and I get this from the command prompt following the last step
C:\Users\inbar.gazit\Desktop> setup.exe /configuration configuration.xml

Office Deployment Tool

SETUP [mode] [path]

SETUP /download [path to configuration file]
SETUP /configure [path to configuration file]
SETUP /packager [path to configuration file] [output path]
SETUP /help

/download Downloads files to create an Office installation source
/configure Adds, removes, or configures an Office installation
/packager Produces an Office App-V package from an Office installation source
/help Displays this message

C:\Users\inbar.gazit\Desktop>

Doesn't seem like it's working. I run elevated on my 64 bit Win8.1 box (which have the RTM latest Office 2016 bits right now)

Anything I'm doing wrong? how can I get the first release bits?

Is there a way to add a command to the application menu(s) ?

Screen Shot 2019-09-10 at 3 59 22 PM

What I am attempting to do: add to the application's file-menu so that below Export... there would be an Export to [my application's name] menu-item that would then open my web-add-in in the taskpane.

It looks like currently context menus and ribbon menus allow for you to create buttons/items within them to prompt the opening of your add-in, but I cannot find any way via the documentation to do what I am asking for. Is that possible?

Thanks,

Invalid add-in manifest

The is an extra element in the ImageSample.xml manifest file between the and tags. Like this:
97
98
99
This is not a valid place for a . The manifest won't validate and in VS, the sample won't build.

SimpleAddin Not Loading, but myHelloWorldaddin works

Hi
I'm able to install and run the myHelloWorldaddin Excel addin described here:
https://dev.office.com/docs/add-ins/get-started/create-an-office-add-in-using-any-editor

But, i cannot run your SimpleAddin.xml.
I do not see the addin listed in Word or Excel.

I executed the command you give for both Word and Excel: defaults write com.microsoft.... etc
And i placed the file in the wef folder, according to the Sideload instructions.

I am running Office 16: version 15.31 (170216).
Do i still need to Get the Office Insider Fast build to use your SimpleAddin?

thx

The actual length is greater than the MaxLength value

The resid for a Label has a maximum length of 32 characters.
Could this be increased to at least 64 characters please.

        <CustomTab id="MyCustomTab">
          <Label resid="01234567890123456789012345678901"/>
        </CustomTab>

Display issue when a group has four buttons

Hi, when I create a group with four buttons, office auto collapse three of them. It looks like this:
image
May I know how to disable the auto collapse? Cause there are enough space to display them one by one. Thanks!

Excel sample expects a specific binding

image

It looks like a binding is selected when the Excel sample app starts up. Should there be a workbook included in the repo? I'd like to see the commands in action.

I'm on the Dynamics AX Office Integration team and my alias is rowill.

Thanks!

writeText from FunctionFile.html does nothing

Hey everyone,
I am currently building my own addin using visual studio. I have created a simple manifest with three buttons. The first two go to separate task pane html and the third button should execute the function writeText from the function file but does not. the function file points to a local copy of https://commandsimple.azurewebsites.net/FunctionFile.html.
In the manifest it looks like https://localhost:44322/App/Home/FunctionFile.html
any hints?

Need a simpler sample to illustrate the basics

Our current samples are ok to get started but it would be better to have a simpler, bare bones example that illustrates:
Controls: Button, Menu
ExtensionPoints: PrimaryCommandSurface and ContextMenu.
Actions: ShowTaskpane and ExecuteFunction

Add smaller icons on two rows on Word

It would be great if we could add smaller icons within the tab menu to match those from Office Word - like on the pic attached. The Big buttons are taking too much space.

Thanks,

Screenshot 2019-05-16 at 23 12 26

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.