当前位置: 动力学知识库 > 问答 > 编程问答 >

c# 4.0 - C# Outlook 2010 Custom Ribbon Button - Get New Item ID?

问题描述:

Is it possible to access the current new item Id, (pre-creation) from a custom ribbon button action?

For example, I have created a new button within the Appointment Tab, so when someone creates a new appointment or meeting, my button is there on the right hand side of the ribbon. I have that wired up to a Click event. What I want to do here, is somehow access some sort of identifier to the currently being composed appointment/meeting, when that button is clicked.

So I'm wondering;

- does outlook create some sort of ID for the message, even before clicking 'Send' or 'Save' ? And if so is this obtainable?

EDIT:

Just thought I'd add, an alternative/workaround for me would be if I could somehow bind or add data to the appointment, which I could then retrieve through some sort of listener when the appointment gets created (which I would then have the ID for). I'm hoping this will definitely be possible given the other ribbon buttons perform actions on the appointment when it's created?

网友答案:

RibbonControl is passed as an argument to your event handler. RibbonControl.Context will be the Inspector object (or Explorer if your button is on the Explorer ribbon). Use the Inspector.CurrentItem property to retrieve the item.

分享给朋友:
您可能感兴趣的文章:
随机阅读: