Hi All:

I'm running the tutorial from here:


http://msdn.microsoft.com/library/de...HV01079910.asp

I'm doing it with Excel instead of Word.

The only thing from the tutorial I haven't been able to accomplish is to
make the ActiveX control (Calendar in this case) Click event work, because I
haven't figured out how to translate that part of the example to Excel.

I know that Document will be Workbook, not sure about Selection.
Any guidance will be highly appreciated.

This is the relevant code:

Microsoft.Office.Interop.Word.Document objDoc;
Microsoft.Office.Interop.Word.SmartTagAction objCalendar;
Microsoft.Office.Interop.Word.Selection objSel;

objDoc = (Microsoft.Office.Interop.Word.Document)Document;
objSel = objDoc.ActiveWindow.Selection;

foreach (Microsoft.Office.Interop.Word.SmartTagAction objAction
in objSel.XMLParentNode.SmartTag.SmartTagActions)
{
if (objAction.Name=="Calendar")
{
objCalendar = objAction;

if (objCalendar.PresentInPane == true)
{
objCal = (MSACAL.Calendar)objCalendar.ActiveXControl;
objCal.Click += new
MSACAL.DCalendarEvents_ClickEventHandler(CalendarClick);
break;
}
}
}

Thanks in advance,
Pete B.