开发者

Outlook Object Model - Hooking to the Conversation Cleanup Feature

开发者 https://www.devze.com 2023-04-09 03:23 出处:网络
Outlook 2010 has a feature called Convesation Cleanup. This feature is implemented using the Conversation Header Outlook Object Model.

Outlook 2010 has a feature called Convesation Cleanup. This feature is implemented using the Conversation Header Outlook Object Model.

I would like to hook to this call and perform an action when triggered, yet I can't figure out how to catch it/hook on to it. Is anyone aware i开发者_JAVA百科f this is possible? If its not, are you aware of any way around it? I have tried using outlook spy to view the event log when executing 'conversation cleanup' with no luck (nothing logged)... is there anyway of viewing deeper tracing of outlook events?


It turns out to be quite simple. The initial step is to obtain the idMso of the desired button to override. Microsoft provides a list of all the control ids for the Office suite however I found faster and more user friendly way of obtaining the idMso.

  • Office Button/File -> Options -> Customize Ribbon -> Hover mouse on desired command - idMso is displayed in brackets

Once we have the desired ids, we edit the Ribbon.xml by adding a set of commands to override the onAction/Enable settings of the button. See example bellow;

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <commands>
    <command idMso="IgnoreConversation" onAction ="FooRoutine" enabled="true"/>
  </commands>
  <ribbon>
  </ribbon>
</customUI>

Last, we create the desired function on the Ribbon.vb which will be executed once the button is pressed.

I strongly suggest that you watch the 8 minute MSDN video where the steps above have been very well explained.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号