Office外接程序MS Project任务窗格:权限被拒绝

问题描述 投票:0回答:1

[昨天(19-Jul-19)最近更新之后。尝试执行时,我无法获得任何Office JS方法的权限。

下面是配置

  1. Windows 10 64位
  2. 用于Office 365 MSO(16.0.11328.20362)64位的MS项目
  3. Word for Office 365 MSO(16.0.11328.20362)64位

实际上,对于所有办公产品,以上版本均适用。

这是直到昨天都非常有效的示例方法

 async run() {


  var taskGuid;

// Get the GUID of the selected task
    Office.context.document.**getSelectedTaskAsync**(
        function (result) {
          if (result.status === Office.AsyncResultStatus.Succeeded) {
            taskGuid = result.value;

            // Set the specified fields for the selected task.
            var targetFields = [Office.ProjectTaskFields.Name, Office.ProjectTaskFields.Notes];
            var fieldValues = ['Tidy International Task', 'Notes for the task from Tidy.'];

            // Set the field value. If the call is successful, set the next field.
            for (var i = 0; i < targetFields.length; i++) {
              Office.context.document.setTaskFieldAsync(
                  taskGuid,
                  targetFields[i],
                  fieldValues[i],
                  function (result) {
                    if (result.status === Office.AsyncResultStatus.Succeeded) {
                      i++;
                    }
                    else {
                      var err = result.error;
                      console.log(err.name + ' ' + err.code + ' ' + err.message);
                    }
                  }
              );
            }
          } else {
            var err = result.error;
            console.log(err.name + ' ' + err.code + ' ' + err.message);
          }
        }
    );

  }

NB:这只是示例方法。我的实际加载项还有很多其他功能,具体取决于Office-JS上下文对象

这是错误的屏幕截图

enter image description here

在我的manifest.xml中:权限设置为ReadWriteDocument

任何帮助将不胜感激。

office-js office-addins ms-project
1个回答
0
投票

也许这会帮助某人。这是Microsoft的一个开放式错误,已于2019年8月14日提供此版本。

下面的参考链接:

https://github.com/OfficeDev/office-js/issues/631

谢谢

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.