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 current; | |
app.hostTypes = { Word :"Word", PowerPoint :"PowerPoint", Excel :"Excel"}; | |
app.getHost = function () { | |
if (current == null) { | |
if (Office.context.requirements.isSetSupported('WordApi')) { | |
current = app.hostTypes.Word; | |
} else if (Office.context.requirements.isSetSupported('ExcelApi')) { | |
current = app.hostTypes.Excel; | |
} else { | |
var host = $.urlParam("_host_Info"); |
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
/// getMailType() | |
/// This function determines the type of email item currently being composed | |
/// - If it is a new item, it returns "New" | |
/// - If it is a reply, it return "Reply" | |
/// - If it is a Forward it returns "Forward" | |
/// - And if it cannot determine, it returns "UnknownReplyOrForward" | |
/// This accepts a function that is called with the resulting value. | |
function getMailType(returnFunction) { | |
// get the conversation ID - if it exists | |
var id = Office.cast.item.toItemCompose(Office.context.mailbox.item).conversationId; |
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
// Helper function to call the web service controller | |
app.makeAjaxCall = function (command, params, callback, error) { | |
var dataToPassToService = { | |
Command: command, | |
Params: params | |
}; | |
$.ajax({ | |
url: '../../api/WebService', | |
type: 'POST', | |
data: JSON.stringify(dataToPassToService), |
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
/// <summary> | |
/// CORE SERVICE FUNCTION | |
/// This function will take a web request which will contain the command the caller wants | |
/// to initate and then the paramaters needed for that call. We enter a SELECT statement | |
/// below to determine the command given and we then call the proper helper function | |
/// </summary> | |
/// <param name="request"></param> | |
/// <returns></returns> | |
[HttpPost()] | |
public WebServiceResponse WebService(WebServiceRequest request) |
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
// PUBLIC: creates a new emails message with a single attachment and sends it | |
// RETURNS: 'success' is compelted successfully | |
easyEws.sendPlainTextEmailWithAttachment = function (subject, body, to, attachmentName, attachmentMime, successCallback, errorCallback) { | |
var soap = '<m:CreateItem MessageDisposition="SendAndSaveCopy">' + | |
' <m:Items>' + | |
' <t:Message>' + | |
' <t:Subject>' + subject + '</t:Subject>' + | |
' <t:Body BodyType="Text">' + body + '</t:Body>' + | |
' <t:Attachments>' + | |
' <t:ItemAttachment>' + |
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
// Loads the form items to attach to events | |
function loadForm() { | |
$("#forward-button").click(function () { | |
getCurrentMessage(); | |
}); | |
} | |
// This function handles the click event of the sendNow button. | |
// It retrieves the current mail item, so that we can get its itemId property | |
// ans also get the MIME content |
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
/*! | |
* logger JavaScript Library v1.0.1 | |
* http://davecra.com | |
* | |
* Copyright David E. Craig and other contributors | |
* Released under the MIT license | |
* https://tldrlegal.com/license/mit-license | |
* | |
* Date: 2016-08-09T12:00EST | |
*/ |
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
/// <summary> | |
/// EXTENSION METHOD | |
/// Get all the appointments between the given date times | |
/// </summary> | |
/// <param name="PobjItems"></param> | |
/// <param name="PobjStart"></param> | |
/// <param name="PobjEnd"></param> | |
/// <returns></returns> | |
public static List<Outlook.AppointmentItem> FindAppointments(this Outlook.Items PobjItems, |
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
/// <summary> | |
/// EXTENSION METHOD | |
/// Get all the appointments between the given date times | |
/// </summary> | |
/// <param name="PobjItems"></param> | |
/// <param name="PobjStart"></param> | |
/// <param name="PobjEnd"></param> | |
/// <returns></returns> | |
public static List<Outlook.AppointmentItem> FindAppointments(this Outlook.Items PobjItems, | |
DateTime PobjStart, |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<OfficeApp | |
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" | |
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" | |
xsi:type="TaskPaneApp"> | |
<Id>5226365f-62d0-435f-a4af-cc6a7bd753b2</Id> | |
<Version>1.0.0.1</Version> | |
<ProviderName>TheOfficeContext.com</ProviderName> |