【问题标题】:How to get document share link using OfficeJs in a task pane app?如何在任务窗格应用程序中使用 OfficeJs 获取文档共享链接?
【发布时间】:2018-01-13 14:40:40
【问题描述】:

当前是否可以获取已打开文档的共享链接(仅查看或编辑)?我想知道发送链接或添加其他用户的任务是否可以通过预定逻辑从 javascript 自动执行。

【问题讨论】:

    标签: office-js office-addins excel-addins


    【解决方案1】:

    查看document.getFilePropertiesAsync 方法。

    如果存在,结果对象将包含文件 url。

    function getFileUrl() {
        //Get the URL of the current file.
        Office.context.document.getFilePropertiesAsync(function (asyncResult) {
            var fileUrl = asyncResult.value.url;
            if (fileUrl == "") {
                showMessage("The file hasn't been saved yet. Save the file and try again");
            }
            else {
                showMessage(fileUrl);
            }
        });
    }
    

    【讨论】:

      猜你喜欢
      • 2018-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-28
      相关资源
      最近更新 更多