Office.js - Excel js AddIn 复制到剪贴板
我试图使用 copy-to-clipboard(https://github.com/sudodoki/copy-to-clipboard)。这个 npm 包内部使用 document.execCommand('copy') 命令将数据复制到剪贴板。我在 chrome 开发控制台中尝试了此操作,命令正常工作。这在 Excel Desktop 中有效,但在 Excel Web 中失败。我尝试了一些其他替代方法来复制数据,但它们在网络上失败了。这是一个已知的限制吗?或者有人可以帮助我如何在 Excel Web 命令中将数据复制到剪贴板吗?
I was trying to copy data to clipboard as part of custom tab ribbon commands in Excel using copy-to-clipboard(https://github.com/sudodoki/copy-to-clipboard). This npm package internally using document.execCommand(‘copy’) commands to copy data to clipboard. I tried this in chrome dev console and command is working. This was working in Excel Desktop but its failing in Excel Web. I tried few other alternatives to copy data but they are failing in web. Is this a known limitation or can someone help me how you can copy data to clipboard in Excel web commands ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的。 Officejs没有提供任何东西。您可以使用
当开发团队完成计划过程时,考虑了技术社区的功能请求。使用github标签:
类型:产品功能请求
at https://aka.ms/ M365Dev-Suggestions 。Correct. OfficeJS doesn't provide anything for that. You may sill use the Document.execCommand() API which includes "copy", "cut" and "paste". But it was deprecated and may not work in the web browsers any longer.
Feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label:
Type: product feature request
at https://aka.ms/M365dev-suggestions .