This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge" /> | |
<title>Excel Basic Add-In</title> | |
<!--using JQuery CDN so we do not need to include--> | |
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> | |
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script> | |
<script type="text/javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Select Which Sprint to Launch</title> | |
<meta charset="utf-8" /> | |
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script> | |
<script src="Scripts/jquery-3.1.1.js" type="text/javascript"></script> | |
<script src="launcher.js" type="text/javascript"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="Scripts/jquery-3.1.1.js" /> | |
(function () { | |
'use strict'; | |
Office.initialize = function (reason) { | |
$(document).ready(function (reason) { | |
/// Upon load connect to the server and request | |
/// the sprints so that we can fill the select | |
/// field on the form. | |
makeAjaxCall("GetSprints", null, function (response) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
namespace OutlookLauncherDemoWeb.Controllers | |
{ | |
public class DefaultController : ApiController |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenFileDialog openFileDialog1 = new OpenFileDialog(); | |
openFileDialog1.Filter = "Excel Files|*.xls*"; | |
DialogResult result = openFileDialog1.ShowDialog(); | |
if (result == DialogResult.OK) | |
{ | |
new Thread(() => | |
{ | |
Excel.Application excelApp = null; | |
Excel.Workbook excelWorkbook = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Marshal.ReleaseComObject(excelWorkbook); | |
Marshal.ReleaseComObject(excelApp); | |
excelApp = null; | |
excelWorkbook = null; | |
GC.Collect(); | |
GC.Collect(); | |
GC.WaitForPendingFinalizers(); | |
GC.WaitForFullGCComplete(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handles messages coming from the parent | |
*/ | |
function startMessageHandler() { | |
setTimeout(function() { | |
var message = localStorage.getItem("dialogMessage"); | |
localStorage.setItem("dialogMessage", ""); // clear the message | |
if(message !== undefined && message !== null && message != "") | |
{ | |
var msg = JSON.parse(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reset first to make sure we get a fresh object | |
Progress.Reset(); | |
// display a progress bar form and set it from 0 to 100 | |
Progress.Show("Please wait while this happens...", 0, 100, function() { | |
// once we are done - when your code | |
// calls Progress.Complete() | |
Alert.Show("All done folks!"); | |
}, function() { | |
// this is only going to be called if the user cancels | |
Alert.Show("The user cancelled"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wait.Show(null, true, function() { | |
Alert.Show("The user cancelled."); | |
}); | |
setTimeout(function(){ | |
Wait.CloseDialog(); | |
Alert.Show("Done!"); | |
}, 15000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = 0; | |
function displayDialog() { | |
var url = "https://localhost:3000/test.html"; | |
Office.context.ui.displayDialogAsync(url,{height:20, width:30, displayInIframe:true}, | |
function (asyncResult) { | |
var dialog = asyncResult.value; // get the dialog | |
var error = asyncResult.error; | |
if(dialog == undefined && error.code > 0) { | |
// log the error | |
console.log(error.message); |