ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SmartDoc ActiveX (https://www.excelbanter.com/excel-programming/324620-smartdoc-activex.html)

Pete B.

SmartDoc ActiveX
 
Hi All:

I'm running the tutorial from he


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(CalendarC lick);
break;
}
}
}

Thanks in advance,
Pete B.


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com