views:

17

answers:

1

In my add-in I build List<> objects of specific file types (which are project items) during the Connect() event. In order to check and possibly append new items as and when these are added I've bound the relevant event:

ProjectsEvents.ItemAdded += ProjectsEvents_ItemAdded;

But the event only passes the Project which contains the new item, not the new item itself. So my question is, inside my ProjectsEvents_ItemAdded(Project proj) event, what's the best way to get this new item?

Do I have to iterate through all items in this project and determine whether I'm already aware of them?

A: 

Try ProjectItemsEvents.ItemAdded.

Will A
Thanks Will, but that only tells me what I already know. I already have the event added and it fires when a new item is added to the project, but to be clear: I want to find out what the newly-added item is, whereas the event only passes (i.e. tells you) which project has just had an item added.I'm hoping to avoid having to go through each item in the project and check whether I already have it, so I'd like to find out if there's a simple way of finding the newly-added item.
awj
According to the page linked to above, awj, this event tells you the *item* that was added - note this is ProjectItemsEvents and not ProjectsEvents.
Will A
Apologies, Will. I took a glance at the link without fully reading the detail. That looks to be what I'm after.
awj