I have a VSTO addin (not a template project), and I'd like to bind to the Entering event for any content controls manually added to the document, but can't figure out how to do the binding.
It's easy enough to find the appropriate Content Controls:
ActiveDoc.ContentControls.Cast<ContentControl>()
.Where(cc => cc.Type == WdContentControlType.wdContentControlDropdownList)
ContentControl doesn't have any events at all, so it seems like I need to somehow obtain a DropDownListContentControl but I haven't been able to figure out how to get that from the ContentControl or any other source.
- You can't just cast ContentControl to DropDownListContentControl because there are no parents in common.
- I thought I might be able to find by using dynamic, but those don't support events.
- In Template Projects ContentControls are created using Globals.Factory.CreateDropDownListContentControl, but that doesn't seem to work for Addin projects.
I'm guessing there's something simple I'm missing, but hours of googling have been fruitless so far.
TIA
