Outlook Object Model - Hooking to the Conversation Cleanup Feature

主宰稳场 提交于 2019-12-12 14:43:25

问题


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 if 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?


回答1:


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.



来源:https://stackoverflow.com/questions/7600181/outlook-object-model-hooking-to-the-conversation-cleanup-feature

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!