Outlook 加载项:连接问题

发布于 2025-01-09 06:36:31 字数 1422 浏览 5 评论 0原文

我创建了一个 Outlook 加载项,并使用管理中心中的集成应用程序将其发布。我使用 Yeoman 创建了该加载项。应用程序状态正常并显示在相关用户的 Outlook 中,但在尝试执行其功能时收到以下错误消息:

对模糊表示歉意,尽管我的源图像很好,但我似乎无法修复该问题

“错误message"

我的 manifest.xml 文件中有以下行调用该函数:

<Action xsi:type="ExecuteFunction">
    <FunctionName>action</FunctionName>
</Action>

并且我在该特定函数中有以下代码:

function action(event) {
  const message = {
    type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
    message: "Web URL opened.",
    icon: "Icon.80x80",
    persistent: true,
  };

  // Show a notification message
  window.open("https://myurl.com");
  Office.context.mailbox.item.notificationMessages.replaceAsync("action", message);

  // Be sure to indicate when the add-in command function is complete
  event.completed();
}

function getGlobal() {
  return typeof self !== "undefined"
    ? self
    : typeof window !== "undefined"
    ? window
    : typeof global !== "undefined"
    ? global
    : undefined;
}

const g = getGlobal();

// The add-in command functions need to be available in global scope
g.action = action;

有谁知道这里会出现什么问题吗?如何修复此问题以在单击按钮时执行重定向?

I created an Outlook add-in and posted it using Integrated Apps in the admin center. I created the add-in using Yeoman. The application status is OK and appears in the Outlook of relevant users, but I get the following error message when trying to execute it's function:

Apologies for the blur, I can't seem to fix that though my source image is fine

Error message

I have the following line in my manifest.xml file calling the function:

<Action xsi:type="ExecuteFunction">
    <FunctionName>action</FunctionName>
</Action>

And I have the following code in that specific function:

function action(event) {
  const message = {
    type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
    message: "Web URL opened.",
    icon: "Icon.80x80",
    persistent: true,
  };

  // Show a notification message
  window.open("https://myurl.com");
  Office.context.mailbox.item.notificationMessages.replaceAsync("action", message);

  // Be sure to indicate when the add-in command function is complete
  event.completed();
}

function getGlobal() {
  return typeof self !== "undefined"
    ? self
    : typeof window !== "undefined"
    ? window
    : typeof global !== "undefined"
    ? global
    : undefined;
}

const g = getGlobal();

// The add-in command functions need to be available in global scope
g.action = action;

Does anyone know how what could be going wrong here? And how I can fix this to execute the redirect when the button is clicked?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文