Select the product you need help with
HOW TO: Handle Events for the Office Web Components in Visual Studio .NETArticle ID: 328275 - View products that this article applies to. This article was previously published under Q328275 On This PageSUMMARY The default class wrappers that are generated by Microsoft
Visual Studio .NET do not allow you to handle events for the Office XP Chart,
Spreadsheet, and PivotTable Web components. To handle the events for these
components, you can modify the source code for these class wrappers, and then
recompile. This article describes how to modify and how to regenerate the class
wrappers for the Office XP Web Components so that you can manage their events
in a Visual Studio .NET application. BackgroundMicrosoft Visual Studio .NET generates an event listener class that implements an event interface. This event listener class is passed to the Office Web Components (OWC). The OWC then calls the QueryInterface for the IDispatch interface, instead of the event interface. However, the IDispatch interface for the generated class does not contain the dispatch identifiers (DISPIDs) for the events. To resolve this issue, you can mark the generated class with the ClassInterfaceType.None value to force COM Interop to return IDispatch for the interface instead of for the class. The IDispatch interface does contain the event DISPIDs.Steps to Modify and to Rebuild Class WrappersNOTE: The steps in this article assume that you have installed the Microsoft Office XP Primary Interop Assemblies (PIAs). For additional information about the Office XP PIAs, click the article number below to view the article in the Microsoft Knowledge Base:328912
(http://support.microsoft.com/kb/328912/EN-US/
)
INFO: Office XP PIAs Available for Download
REFERENCESFor additional information about
managing events for the Office Web Components by using Visual Studio .NET,
click the article numbers below to view the articles in the Microsoft Knowledge
Base: 319342
(http://support.microsoft.com/kb/319342/EN-US/
)
HOW TO: Handle Events for the Office XP Spreadsheet Component on a Windows Form in Visual Basic .NET
319341
(http://support.microsoft.com/kb/319341/EN-US/
)
HOW TO: Handle Events for the Office XP Spreadsheet Component on a Windows Form in Visual C# .NET
319557
(http://support.microsoft.com/kb/319557/EN-US/
)
HOW TO: Handle Events for the Office XP Chart Component by Using Visual Basic .NET
319559
(http://support.microsoft.com/kb/319559/EN-US/
)
HOW TO: Handle Events for the Office XP Chart Component on a Windows Form in Visual C# .NET
PropertiesArticle ID: 328275 - Last Review: July 30, 2003 - Revision: 3.1 APPLIES TO
|


Back to the top








