【发布时间】:2018-01-13 14:40:40
【问题描述】:
当前是否可以获取已打开文档的共享链接(仅查看或编辑)?我想知道发送链接或添加其他用户的任务是否可以通过预定逻辑从 javascript 自动执行。
【问题讨论】:
标签: office-js office-addins excel-addins
当前是否可以获取已打开文档的共享链接(仅查看或编辑)?我想知道发送链接或添加其他用户的任务是否可以通过预定逻辑从 javascript 自动执行。
【问题讨论】:
标签: office-js office-addins excel-addins
查看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);
}
});
}
【讨论】: