View detectMimeType.js
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
/** | |
* Returns the data type based on the base64 string | |
* @param {String} base64String | |
* @param {String} fileName | |
* @returns {String} | |
*/ | |
detectMimeType(base64String, fileName) { | |
var ext = fileName.substring(fileName.lastIndexOf(".") + 1); | |
if (ext === undefined || ext === null || ext === "") ext = "bin"; | |
ext = ext.toLowerCase(); |
View getUsername.js
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
export async function getUserName() { | |
try { | |
let tokenData = await OfficeRuntime.auth.getAccessToken({ allowSignInPrompt: false, forMSGraphAccess: true }); | |
var parts = tokenData.split("."); | |
var token = JSON.parse(atob(parts[1])); | |
return token.preferred_username; | |
} | |
catch (exception) { | |
console.log(exception.message); | |
} |
View SendCustomXmlPartMessage.js
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
const ns = "http://pfe.microsoft.com/excelpoc/1.0"; | |
const xml = "<message xmlns='http://pfe.microsoft.com/excelpoc/1.0'>" + | |
"<sentby>[who]</sentby>" + | |
"<info>[data]</info>" + | |
"</message>"; | |
const from_tp = "TASKPANE ADD-IN"; | |
function sendMessage() { | |
Excel.run(function(context) { | |
var data = xml.replace("[who]", from_tp).replace("[data]", "This message is coming from the taskpane."); | |
const customXmlPart = context.workbook.customXmlParts.add(data); |
View ContentAddInReadCustomXmlPart.js
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
Office.initialize = function(reason) { | |
// background thread checker | |
window.setInterval(() => { checkForPart(); }, 1000); | |
} | |
const ns = "http://pfe.microsoft.com/excelpoc/1.0"; | |
const xml = "<message xmlns='http://pfe.microsoft.com/excelpoc/1.0'>" + | |
"<sentby>[who]</sentby>" + | |
"<info>[data]</info>" + | |
"</message>"; |
View DetectUserPrintInOutlook.cs
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
[DllImport("user32.dll")] | |
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); | |
[DllImport("user32.dll", SetLastError = true)] | |
public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle); | |
/// <summary> | |
/// Startup for Outlook Add-in | |
/// </summary> | |
/// <param name="sender"></param> | |
/// <param name="e"></param> | |
private void ThisAddIn_Startup(object sender, System.EventArgs e) |
View plugins.js
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
plugins: [ | |
new CleanWebpackPlugin(), | |
new HtmlWebpackPlugin({ | |
filename: "taskpane.html", | |
template: "./src/dialogs/taskpane.html", | |
chunks: ["polyfill", "common", "shared", "taskpane"] | |
}), | |
new HtmlWebpackPlugin({ | |
filename: "dialog.html", | |
template: "./src/dialogs/dialog.html", |
View entry.js
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
entry: { | |
polyfill: "@babel/polyfill", | |
dialog: "./src/dialogs/dialog.js", | |
commands: "./src/commands/commands.js", | |
shared: "./src/common/shared.js", | |
common: "./src/common/common.js", | |
taskpane: "./src/taskpane/taspane.js" | |
}, |
View webpack _required.js
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
/*************************************************/ | |
/* REQUIRED BY WEB PACK - DO NOT DELETE */ | |
/*************************************************/ | |
function getGlobal() { | |
return typeof self !== "undefined" | |
? self | |
: typeof window !== "undefined" | |
? window | |
: typeof global !== "undefined" | |
? global |
View Manifest.xml
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> |
View easyewshtmlscriptline.html
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
<script type="text/javascript" src="node_modules/easyews/easyews.min.js"></script> |
NewerOlder