// Global variables
var _Item;
var _MyEntities;
// The initialize function is required for all apps.
Office.initialize = function (reason) {
var _mailbox = Office.context.mailbox;
// Obtains the current item.
Item = _mailbox.item;
// Reads all instances of supported entities from the subject
// and body of the current item.
MyEntities = _Item.getEntities();
// Checks for the DOM to load using the jQuery ready function.
$(document).ready(function () {
// After the DOM is loaded, app-specific code can run.
});
}
// Gets instances of the Address entity on the item.
function myGetAddresses()
{
var htmlText = "";
// Gets an array of postal addresses. Each address is a string.
var addressesArray = _MyEntities.addresses;
for (var i = 0; i < addressesArray.length; i++)
{
htmlText += "Address : <span>" + addressesArray[i] + "</span><br/>";
}
document.getElementById("entities_box").innerHTML = htmlText;
}
我正在使用上面的代码访问电子邮件地址,但我无法在 entity_box div 中看到任何结果。
请建议我怎样才能从它的电子邮件地址获取、抄送和从电子邮件地址获取。