Documente Academic
Documente Profesional
Documente Cultură
Content Add-in
Add-in that runs within a document content with read/write access
Excel, PowerPoint, Access
Add-in Command
Command in the Office UI to launch add-in or perform UI-less operation
Outlook, Outlook Web Access (OWA)
Office Add-in Web
Manifest Page Office Add-in
<XML> HTML+JS
A dialog is presented to the user experience when you call addFromPromptAsync.
Excel.run(function (ctx) { });
1: Context iOS
initialized
Desktop
Web
Excel.run(function (ctx) { iOS
// Create a proxy object for the active worksheet
var sheet = ctx.workbook.worksheets.getActiveWorksheet(); 2: Instructions
sheet.getRange("A1").values = "Quarterly Sales Report";
sheet.getRange("A1").format.font.name = "Century";
Batched
sheet.getRange("A1").format.font.size = 26;
var range = sheet.getRange("A2:E8");
range.values = values;
sheet.getRange("A2:E2").format.font.bold = true;
});
Desktop
Web
Excel.run(function (ctx) { iOS
// Create a proxy object for the active worksheet
var sheet = ctx.workbook.worksheets.getActiveWorksheet();
sheet.getRange("A1").values = "Quarterly Sales Report";
sheet.getRange("A1").format.font.name = "Century";
sheet.getRange("A1").format.font.size = 26;
var range = sheet.getRange("A2:E8");
range.values = values;
sheet.getRange("A2:E2").format.font.bold = true;
return ctx.sync();
});
3. Instructions
Desktop
Sent to Host
Web
Excel.run(function (ctx) { iOS
// Create a proxy object for the active worksheet
var sheet = ctx.workbook.worksheets.getActiveWorksheet();
sheet.getRange("A1").values = "Quarterly Sales Report";
sheet.getRange("A1").format.font.name = "Century";
sheet.getRange("A1").format.font.size = 26;
var range = sheet.getRange("A2:E8");
range.values = values;
sheet.getRange("A2:E2").format.font.bold = true;
return ctx.sync();
}); Desktop
4. Host executes
Instructions
in sequence
Web
Excel.run(function (ctx) { iOS
// Create a proxy object for the active worksheet
var sheet = ctx.workbook.worksheets.getActiveWorksheet();
sheet.getRange("A1").values = "Quarterly Sales Report";
sheet.getRange("A1").format.font.name = "Century";
sheet.getRange("A1").format.font.size = 26;
var range = sheet.getRange("A2:E8");
range.values = values;
sheet.getRange("A2:E2").format.font.bold = true;
return ctx.sync();
})
.then(function () {
Desktop
app.showNotification("Success");
console.log("Success!");
});
5. Callback handles
success
Web
Excel.run(function (ctx) { iOS
// Create a proxy object for the active worksheet
var sheet = ctx.workbook.worksheets.getActiveWorksheet();
sheet.getRange("A1").values = "Quarterly Sales Report";
sheet.getRange("A1").format.font.name = "Century";
sheet.getRange("A1").format.font.size = 26;
var range = sheet.getRange("A2:E8");
range.values = values;
sheet.getRange("A2:E2").format.font.bold = true;
return ctx.sync();
})
.then(function () {
Desktop
app.showNotification("Success");
console.log("Success!");
})
.catch(function (error) {
app.showNotification("Error: " + error);
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + error.debugInfo);
}
Web
});
6. If exception, catch
callback is called
Document
Selection
Section Body
Header
Range
Footer
Font
Paragraph
Picture
ContentControl
Workbook
Worksheets
Tables
Names
Rows
Legend
Format Axes
Title
Font
Series
Fill
Borders
Summary
• Office add-ins Revisited
• Generic Office.js APIs
• Word APIs
• Excel APIs
• Deployment
Getting Started with Office add-ins
Office add-in Code Samples
Office add-in Training videos & hands on labs
Office add-in Snack videos
Office add-in documentation
http://dev.office.com/devprogram
St ar t
https://www.yammer.com/itpronetwork @OfficeDev
http://aka.ms/O365DevShow
http://dev.office.com/podcasts
http://officespdev.userv
oice.com/
©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the
U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft
must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.