Outlook 加载项的常用 JavaScript 函数

发布于 2025-01-16 20:24:52 字数 209 浏览 2 评论 0原文

我有一个 Outlook 插件可以自动插入签名。

对于桌面客户端,manifest.xml 仅引用 1 个 javascript 文件,因此我需要将所有内容放入 1 个文件中。

但是,我想重用它在​​任务窗格中包含的一些函数,这些函数使用另一组 Javascript 文件。

有没有办法创建一个可以包含在任何地方的 common.js 文件?

谢谢

I have an Outlook Add-ins to automatically insert signature.

With desktop client, manifest.xml refers to only 1 javascript file, so I need to put everything in 1 single file.

However, I want to reuse some of the function it contains in the taskpane, which use another set of Javascript files.

Is there a way to create a common.js file that would be included everywhere?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罗罗贝儿 2025-01-23 20:24:52

您可以创建专门用于自动插入签名的 JS 文件,然后将该文件包含在任务窗格的 HTML 中。只需确保此 javascript 文件仅包含 ES6 代码,并且主要包含您希望在签名插入和加载项的任务窗格部分之间共享的 API 调用。另外,将其包含在任务窗格 HTML 文件中,位于任务窗格 JS 文件之后。

或者,可以在此处放置 2 个单独的文件,以避免在将来更新加载项时意外损坏加载项的一部分。

You can create a JS file specifically for automatically inserting the signature, and then include that file in the HTML for the taskpane. Just ensure that this javascript file only contains ES6 code, and mainly API calls that you want to be shared between the signature insertion and the taskpane parts of your add-in. Also, include it in the taskpane HTML file, after the taskpane JS file.

Alternatively, it is OK to have 2 separate files here to avoid accidentally breaking one part of your add-in when you make future updates to it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文