用于解析电子邮件并填充 Django 数据库的 Outlook 插件

问题描述 投票:0回答:1

我正在尝试找到在 Outlook(插件)中获取某种按钮的最佳方法,该按钮将在我的 django 项目上执行一些功能 - 例如解析电子邮件并在其中搜索特定的搅拌,然后填充我的数据库。 我已经使用 BaseCommand 实现了人口统计,但现在我想向 Outlook 应用程序添加一个按钮。 有人这样做过吗?有可能吗?

尝试过https://yeoman.io/

outlook office-js outlook-addin office-addins ribbonx
1个回答
0
投票

您可以使用功能区命令创建 Outlook 加载项。请参阅插件命令部分以快速入门。当用户选择按钮控件时,它会执行单个操作。它可以执行 JavaScript 函数或显示任务窗格。以下示例显示如何定义两个按钮。第一个按钮运行 JavaScript 函数而不显示 UI:

<!-- Define a control that calls a JavaScript function. -->
<Control xsi:type="Button" id="Button1Id1">
  <Label resid="residLabel" />
  <Tooltip resid="residToolTip" />
  <Supertip>
    <Title resid="residLabel" />
    <Description resid="residToolTip" />
  </Supertip>
  <Icon>
    <bt:Image size="16" resid="icon1_32x32" />
    <bt:Image size="32" resid="icon1_32x32" />
    <bt:Image size="80" resid="icon1_32x32" />
  </Icon>
  <Action xsi:type="ExecuteFunction">
    <FunctionName>highlightSelection</FunctionName>
  </Action>
</Control>

<!-- Define a control that shows a task pane. -->
<Control xsi:type="Button" id="Button2Id1">
  <Label resid="residLabel2" />
  <Tooltip resid="residToolTip" />
  <Supertip>
    <Title resid="residLabel" />
    <Description resid="residToolTip" />
  </Supertip>
  <Icon>
    <bt:Image size="16" resid="icon2_32x32" />
    <bt:Image size="32" resid="icon2_32x32" />
    <bt:Image size="80" resid="icon2_32x32" />
  </Icon>
  <Action xsi:type="ShowTaskpane">
    <SourceLocation resid="residUnitConverterUrl" />
  </Action>
</Control>

以下代码显示了 .

使用的示例函数
// Initialize the Office Add-in.
Office.onReady(() => {
  // If needed, Office.js is ready to be called
});

// The command function.
async function highlightSelection(event) {

    // Implement your custom code here. The following code is a simple Excel example.  
    try {
          // do something
      } catch (error) {
          // Note: In a production add-in, notify the user through your add-in's UI.
          console.error(error);
      }

    // Calling event.completed is required. event.completed lets the platform know that processing has completed.
    event.completed();
}

// You must register the function with the following line.
Office.actions.associate("highlightSelection", highlightSelection);

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.