且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

确定Office加载项的首次运行

更新时间:2023-12-05 23:08:04

很高兴听到有人关心用户体验,甚至还想编写出首次运行指南;)

It's great to hear somebody care about user experience and even want to put together first run guide;)

可以在清单中设置不同的初始页面吗??

Can different initial pages be set within the manifest, ...?

否,清单没有任何内容指向Web应用程序的一次性使用"页面.

No, manifest do not have anything to point to "one time use" pages of your web application.

...还是在第一次运行时是否需要使用Javascript进行重定向?

... or do I need to use Javascript to redirect on the first run in some manner?

是的,这正是您想要做的.如果用户第一次运行您的应用,则可以重定向到一些指南页面;如果您使用单页应用程序预览用户指南,则可能还会显示和隐藏<div>图层.我什至看到一个花哨"的应用程序,它在您的应用程序控件的顶部显示了透明层,并带有解释,看起来很酷,是第一次使用时的上下文手册.

Yes, this is exactly you would want to do. You may redirect to some guide page(s) if user runs your app first time; you may also show and hide <div> layers if you use single page application to preview user guide. I even saw one "fancy" app which displayed transporant layers on the top of the controls of your app with explanation, was looking very cool, kinda context manual for the first time use.

我想知道确定外接程序是否是第一次加载以及是否已加载的***方法是什么?

I was wondering what the best method of determining whether or not the addin was loaded for the first time and if it was...?

从我的角度来看,***的方法是使用 RoamingSettings 对象可以设置某种标记,如果用户浏览了指南并不想再看到它.该对象将在Office.initialize之后立即可用,因此您可以尝试获取此标记(键)并根据需要重定向到您的应用程序页面或指南页面.

The best way, from my point of view, would be to use RoamingSettings object to set some kind of mark if user went through your guide and doesn't want to see it any longer. This object will be available right after Office.initialize, so you can try to get this mark (key) and redirect to your app page(s) or your guide page(s) according.