首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >中messageRead和messageWrite模式的逻辑?

中messageRead和messageWrite模式的逻辑?
EN

Stack Overflow用户
提问于 2019-03-11 11:11:59
回答 1查看 193关注 0票数 2

目前正在开发基于javascript的outlook外接程序。启动外接程序时,我希望在读和写模式下打开不同的对话框。

如何检查外接程序是否处于消息读取或写入模式?

manifest.xml

代码语言:javascript
复制
<!-- Message Read -->
    <ExtensionPoint xsi:type="MessageReadCommandSurface">
    <!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
    <OfficeTab id="TabDefault">
        <!-- Up to 6 Groups added per Tab -->
        <Group id="msgReadGroup">
        <Label resid="groupLabel" />
        <!-- Launch the add-in : task pane button -->
        <Control xsi:type="Button" id="msgReadOpenPaneButton">
            <Label resid="paneReadButtonLabel" />
            <Supertip>
            <Title resid="paneReadSuperTipTitle" />
            <Description resid="paneReadSuperTipDescription" />
            </Supertip>
            <Icon>
            <bt:Image size="16" resid="icon16" />
            <bt:Image size="32" resid="icon32" />
            <bt:Image size="80" resid="icon80" />
            </Icon>
            <Action xsi:type="ShowTaskpane">
            <SourceLocation resid="messageReadTaskPaneUrl" />
            </Action>
        </Control>
        </Group>
    </OfficeTab>
    </ExtensionPoint>


<!-- Message Compose -->
    <ExtensionPoint xsi:type="MessageComposeCommandSurface">
        <OfficeTab id="TabDefault">
            <Group id="msgComposeCmdGroup">
            <Label resid="groupLabel"/>
            <Control xsi:type="Button" id="msgComposeIndex">
                <Label resid="indexLabel"/>
                <Supertip>
                <Title resid="indexTitle"/>
                <Description resid="insertGistDesc"/>
                </Supertip>
                <Icon>
                <bt:Image size="16" resid="icon16"/>
                <bt:Image size="32" resid="icon32"/>
                <bt:Image size="80" resid="icon80"/>
                <bt:Image size="80" resid="paksign"/>

                </Icon>
                <Action xsi:type="ShowTaskpane">
                <SourceLocation resid="index-file" />
                </Action>
            </Control>
            </Group>
        </OfficeTab>
    </ExtensionPoint>
EN

回答 1

Stack Overflow用户

发布于 2019-03-14 00:12:09

我们建议使用不同的SourceLocation URL,或者向URL添加查询参数,以区分不同的模式(即...index.html?mode=MessageRead)。

在示例清单中,这意味着对messageReadTaskPaneUrlindex-file URL使用不同的URL或查询参数。

虽然可以检查是否定义了API以尝试确定模式,但我们不建议这样做,因为将来可以添加API。例如,Office.context.mailbox.item.from最初只在API 1.0 ( undefined在组合模式下)中以读模式定义。但是,当Office.context.mailbox.item.from.getAsync添加到要求集1.7中的组合模式时,这种情况发生了变化。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55100558

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档