在我自己的安装程序上运行时,如何诊断Word加载项验证失败? [英] How to diagnose failed validation of Word Add-In when it works on my own setup?

查看:104
本文介绍了在我自己的安装程序上运行时,如何诊断Word加载项验证失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发MS Word加载项.我已经在Windows和Mac上对其进行了测试,并且对我来说效果很好. Microsoft需要对加载项进行自己的验证,以确保它们可以正常运行,即使我在相同版本的Windows和Word上也可以使用我的加载项,我的加载项也会失败.

I'm developing an MS Word Add-In. I've tested it on both Windows and Mac, and it works fine for me. Microsoft requires its own validation of Add-Ins to make sure they work correctly, and my Add-In fails for them even though it works for me with the same version of Windows and Word.

我与Microsoft验证团队打了个电话,他们唯一的建议是我在Stack Overflow上发布一个问题,就这样!

I had a phone call with the Microsoft Validation team, and their only suggestion was that I post a question on Stack Overflow so here goes!

这是适用于我的Windows和Word版本,但对于MS Validation团队而言是失败的:

This is the version of Windows and Word that works for me but fails for the MS Validation team:

  • Windows 10 Pro操作系统内部版本18362.295
  • Word 2016(尤其是1908版)

我为调试目的向Microsoft提交了一个非常简单的加载项.这个简单的加载项只有一个按钮,可以在用户的​​默认浏览器中打开网页.

I submitted a very simple add-in to Microsoft for debugging purposes. This simple add-in has only a single button that just opens a web page in the user's default browser.

这是清单的相关部分:

            <Control xsi:type="Button" id="PB.Home.Button">
              <Label resid="PB.Home.Button.Label"/>
              <Supertip>
                <Title resid="PB.Home.Button.Title"/>
                <Description resid="PB.Home.Button.Desc"/>
              </Supertip>
              <Icon> ... </Icon>
              <Action xsi:type="ExecuteFunction">
                <FunctionName>navigateToWebPage</FunctionName>
              </Action>
            </Control>

这是FunctionFile.html的全部:

<!DOCTYPE html>
<html>
<head>
  <title></title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" ></script>
  <script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js" type="text/javascript"></script>
  <script src="FunctionFile.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>

这是FunctionFile.js的全部:

(function () {
  Office.initialize = function (reason) {};
})();

function navigateToWebPage(event) {
  window.open('https://www.example.com', '_blank');
  event.completed();
}

在我的计算机上,单击该按钮时,浏览器选项卡随网页打开,但是对于MS Validation团队,此消息显示在Word窗口底部的工具栏中

On my computer, when the button is clicked, a browser tab is opened with the web page, but for the MS Validation team this message appears in the toolbar at the bottom of the Word window

,但没有其他任何反应.

but nothing else happens.

Word而不是我的加载项生成消息"Patent Bots GCP正在处理您的审查员统计信息"."Patent Bots GCP"是加载项的名称,"Examiner Statistics"是按钮标签(一个清单中的短字符串).

The message "Patent Bots GCP is working on your Examiner Statistics" is generated by Word and not by my add in. "Patent Bots GCP" is the name of the add in and "Examiner Statistics" is the button label (one of the short strings in the manifest).

关于如何找出Microsoft验证团队失败的任何建议?除了我在此处提供的内容外,他们无法提供有关该错误的任何详细信息.

Any suggestions for how I can find out what is failing for the Microsoft Validation team? They are not able to provide any details about the error other than what I've included here.

我希望Microsoft工程师能够看到并能够提供帮助.

I hope a Microsoft engineer sees this and is able to help.

=====

也许这是一个弹出窗口阻止程序问题?请参阅: https://www.tek-tips.com/viewthread.cfm ?qid = 949178

Maybe it is a popup blocker issue? See this: https://www.tek-tips.com/viewthread.cfm?qid=949178

推荐答案

@gaefan.如果将来有人遇到相同的问题,也只需添加我的答案.

@gaefan. Just adding my answer too if any one will have the same problem in future.

如果有人尝试使用JS window.open从其外接程序打开外部站点,则Microsoft肯定会出现Object Expected aka验证失败错误.它取决于Windows 10 Build版本,Office版本和

If anyone trying to open the external site from their add-in using JS window.open will end up in Object Expected aka validation failure error definitely by Microsoft. It depends on various factors like Windows 10 Build version, Office version and the Browser used by Add-ins.

因此,要在App源代码中成功发布您的加载项,请执行以下操作:

So to publish your add-in successfully in the App source:

注意:此方法是一种解决方法.但是在不久的将来,如果发布新的Edge铬版本.加载项使用的浏览器将被更改.然后可以消除该解决方法.

  1. 如果要从外接程序打开任何外部站点,请使用Task Pane外接程序方法.
  2. 重新命名Task-pane加载项的原因是您可以利用HTML中的anchor tag,如下所示

  1. Use Task Pane add-in approach if your want to open any external site from Add-in.
  2. The reason for recommonding Task-pane add-in is you can make utilize the anchor tag in your HTML like below

    <a
    href="https://yourcompany.com/"
    class="button-config"
    target="_blank"
    (click)="performOperation()"
    >Sign up
    </a>

点击事件的原因是触发任何analytics functiontrigger logsadd your custom logic

The reason for click event is to trigger any analytics function or trigger logs or add your custom logic

  1. 这肯定会打开外部站点,而无需更改浏览器上的任何设置.

  1. This will definitely open the external site without changing any settings on your browser.

如果要继续使用command based add-in,请尝试添加新的Action or Control button以通过定位标记打开外部站点.

If you want to stick on with command based add-in try adding new Action or Control button to open a external site via anchor tag.

希望对您有所帮助.谢谢

Hope it will help some one. Thanks

这篇关于在我自己的安装程序上运行时,如何诊断Word加载项验证失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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