Globals.Ribbons集合是空的 [英] Globals.Ribbons collection is empty

查看:87
本文介绍了Globals.Ribbons集合是空的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨大家好,

我正在使用Visual Studio 2008为Outlook 2007开发AddIn.AddIn有一个用于创建特殊电子邮件的表单区域和一个提供自定义功能的功能区。

I'm developing an AddIn for Outlook 2007 with Visual Studio 2008. The AddIn has a form region for creating special emails and a ribbon providing custom functionality.

为了说明一个例子,假设功能区上有一个切换按钮,表单区域上有一个复选框。现在,如果我使用表单区域撰写新邮件并选中复选框,我也想检查切换按钮。

To illustrate an example let's say there is a toggle button on the ribbon and a checkbox on the form region. Now, if I compose a new message with my form region and check the checkbox, I would like to have the toggle button checked, too.

我发现在检查功能区上的切换按钮时我可以使用以下内容:

I found out that I can use the following when checking the toggle button on the ribbon:







Globals.FormRegions(Globals.MyAddIn.Application.ActiveInspector).MyFormRegionName.MyCheckBox

推荐答案

让我来扩展这个帖子。

我只是关于表格区域和丝带的全局集合,有很多东西。当我只用我的表单区域打开一个检查器窗口时,一切都很好。比我没有上面提到的问题,因为我不必将表单区域与功能区关联,因为应该只有一个。但是,在关闭第一个打开的检查器窗口后打开第二个检查器窗口时,有一些有趣的事情。

例如,我启动了Outlook并使用我的表单区域打开一条新消息,关闭该窗口并打开另一个消息表单区域:

在处理功能区控件的回调函数时,我检查了Globals.FormRegions集合。我发现了两件物品。为什么有两件物品?关闭检查器窗口以完全卸载已使用的表单区域时,是否必须执行一些特殊操作?重新启动Outlook后,此行为是相同的。我发现在不同模式下打开表单区域时,表单区域的数量会增加:撰写和读取。我甚至在该系列中有三件物品。我的错误在哪里?

Let me just extend this thread.

I just tested a lot of things concerning the globals collections for form regions and ribbons. When I only open one inspector window with my form region everything is fine. Than I do not have the problem mentioned above because I do not have to associate a form region with a ribbon because there should be one only. But just when opening a second inspector window after closing the first opened inspector window there is some interesting.

For example I started Outlook and open a new message with my form region, close that window and open another message with my form region:

While handling the callback function of the ribbon controls I checked the Globals.FormRegions collection. And I found two items. Why are there two items? Do I have to do something special on closing the inspector window to completely unload the used form region? After a restart of Outlook this behaviour is the same. I found out that the number of form regions raises when opening my form region in different modes: compose and read. I even have had three items in that collection. Where is my mistake?

谢谢

Mõbius


这篇关于Globals.Ribbons集合是空的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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