office.context.mailbox未定义

时间:2017-06-30 11:25:28

标签: outlook-addin office-js

当我尝试在outlook.i中打开弹出窗口时,我在弹出控制器中获取office.context.mailbox未定义。但是我在控制器中获得了office对象。请建议。代码在下面

(function() {
    'use strict';
    angular.module('wpoffice')
        .component('externalTrack', 
            templateUrl: 'app/components/externalTrack/external-track_template.html',
            controller: ExternalTrackController,
            bindings: {}
        });
​
    /** ngInject*/
​
    function ExternalTrackController($rootScope, $scope, $timeout, appData, ngNotify,$q,trackingService) {
        var self = this;
        self.$onInit = activate;
        function activate() {
            console.log(Office)
            console.log(Office.context.mailbox);
    }
}
})();

1 个答案:

答案 0 :(得分:1)

您无法在对话框API启动的弹出窗口中访问大多数功能,如果您使用window.open,我认为没有理由可以使用。

The messageParent function is one of only two Office APIs that can be called in the dialog box. (The other is Office.context.requirements.isSetSupported) Dialog API docs