如何在功能区中的一个按钮,点击后显示一个办公室/ 2013的Word任务窗格中的“办公室应用程序”? [英] How to show an Office/Word 2013 Task Pane 'Office App' after a click on a button in Ribbon?

查看:274
本文介绍了如何在功能区中的一个按钮,点击后显示一个办公室/ 2013的Word任务窗格中的“办公室应用程序”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个任务窗格应用程序与新的Office应用程序的模型。它使用jQuery和REST服务从SharePoint中(2013字)任务窗格搜索和显示数据。该工程确定,但在App任务窗格应点击功能区中的自定义按钮后启动。

I've created a Task Pane App with the new Office App model. It uses JQuery and a REST Service to search and display data from SharePoint in the (Word 2013) Task Pane. This works ok, however the App Task Pane should be activated after clicking on a custom button in the ribbon.

要创建按钮,我创建一个Word 2013外接程序项目,以下自定义用户界面XML:

To create the button, I've created a Word 2013 Addin project with following Custom UI XML:

    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <ribbon>
        <tabs>
          <tab idMso="TabHome">
            <group id="ContentGroup" label="SharePoint App">
              <button id="spAppButton" label="SharePoint App" imageMso="FunctionsLookupReferenceInsertGallery" size="large" onAction="OnAppButton"/>
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>

在回调方法我有机会获得Microsoft.Office.Interop.Word.Application应用程序对象:

In the callback method I have access to the Microsoft.Office.Interop.Word.Application Application Object:

    public void OnAppButton(Office.IRibbonControl control)
    {

    Globals.ThisAddIn.Application ...

不过,我想不通我怎么可以使用此API可能激活Office应用程序。

However I cannot figure out how i can possibly activate the Office App using this Api.

我试过例如枚举命令栏和命令,但我找不到这是关系到应用服务办公室的任何命令。

I've tried for example to enumerate the Commandbars and Commands, but I cannot find any command which is related to Apps for Office.

我可以添加自定义Taskpane并显示它,但不显示Office应用程序。如果我没有记错的话,会在这条道路将意味着从头开始开发应用程序作为一个传统C#的Word加载项。我想但是使用新的Office应用程序模式,并显示我在任务窗格中已经创建的应用程序。

I can add a custom Taskpane and display it, however that does not display the Office App. If I'm not mistaken, going down that road would mean developing the app from scratch as a 'traditional' C# Word Addin. I would like to use the new Office App Model however and show the App I've created already in the task pane.

有没有人有一个想法如何,这将有可能实现(显示在OnAppButton回调方法(JQuery的/ HTML)Office任务窗格应用程序)?

Does anyone have an idea how this would be possible to achieve (showing the (JQuery/HTML) Office Task Pane App from the OnAppButton callback method)?

关于应用服务办公室的更多信息,请访问:
https://msdn.microsoft.com/en-us/library/office/jj220060.aspx

More information regarding 'Apps for Office' is available here: https://msdn.microsoft.com/en-us/library/office/jj220060.aspx

非常感谢你,我一直试图弄清楚这一点有一段时间了,但我不会取得任何进展。

Thank you very much, I've tried to figure this out for some time now, but I'm not making any progress.

推荐答案

在Office扩展模型不适用于运行Office应用程序编程提供什么。

The Office extensibility model doesn't provide anything for running Office Apps programmatically.

这篇关于如何在功能区中的一个按钮,点击后显示一个办公室/ 2013的Word任务窗格中的“办公室应用程序”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆