Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath
Several events are found in Visual Studio 2005 Tools for Office objects that are not found when using the Excel PIA alone. Table 4.2 lists these events. Almost all these events are events from the Excel PIA that are raised again on different objects. In the Excel PIA, for example, there is no BeforeDoubleClick event on a Range object; in fact, there are no events on the Range object at all. In VSTO, the two objects that VSTO defines that represent a Range (NamedRange and XMLMappedRange) have a BeforeDoubleClick event. VSTO adds the BeforeDoubleClick event to these objects and raises the event whenever the Worksheet.BeforeDoubleClick event is raised and passed a Range object that matches the given NamedRange or XMLMappedRange object.
Another case where VSTO changes events is in the naming of the Activate event and the Select event on the Worksheet object. Both of these event names conflict with method names on Worksheet. To prevent this conflict, VSTO renames these events ActivateEvent and SelectEvent. There are also some new events, such as the Startup and Shutdown events, raised on VSTO project host items such as Workbook, Worksheet, and ChartSheet. ListObject also has several new events that are raised when a ListObject is data bound. |
Категории