Automation Samples Using Managed Code

I was searching Microsoft KB and found some nice links ...it May helps u too....I am trying to call Excel Event from managed COM Add In....unfortunatly did not found any document about it....

Automation Samples Using Managed Code (Visual Basic or Visual C#)

For additional information about working in .NET, click the article numbers below to view the articles in the Microsoft Knowledge Base:

Microsoft Excel

301982 HOWTO: Automate Microsoft Excel from Visual Basic .NET

302084 HOWTO: Automate Microsoft Excel from Microsoft Visual C# .NET

302814 HOW TO: Handle Events for Excel by Using Visual Basic .NET

302815 HOW TO: Handle Events for Excel by Using Visual C# .NET

302094 HOWTO: Automate Excel From Visual Basic .Net To Fill or Obtain Data In a Range Using Arrays

302096 HOWTO: Automate Excel With Visual C# .NET To Fill or Obtain Data In a Range Using Arrays

306022 HOW TO: Transfer Data to an Excel Workbook by Using Visual Basic .NET

306023 HOW TO: Transfer Data to an Excel Workbook by Using Visual C# .NET

307021 HOW TO: Transfer XML Data to Microsoft Excel 2002 by Using Visual Basic .NET

307029 HOW TO: Transfer XML Data to Microsoft Excel 2002 by Using Visual C# .NET

Microsoft Word

316383 HOW TO: Automate Word from Visual Basic .NET to Create a New Document

316384 HOW TO: Automate Word from Visual C# .NET to Create a New Document

301656 HOWTO: Automate Microsoft Word to Perform a Mail Merge from Visual Basic .NET

301659 HOWTO: Automate Microsoft Word to Perform Mail Merge from Visual C# .NET

302816 HOWTO: Handle Events for Microsoft Word Using Microsoft Visual Basic .NET

302817 HOWTO: Handle Events for Word Using Visual C# .NET

Microsoft PowerPoint

303717 HOWTO: Use Automation to Create and Show a PowerPoint Presentation with Visual Basic .NET

303718 HOWTO: Use Automation to Create and Show a PowerPoint Presentation with Visual C# .NET

308330 HOWTO: Handle PowerPoint Events With Visual Basic .NET

308825 HOWTO: Handle PowerPoint Events With Visual C# .NET

Microsoft Access

317113 HOW TO: Automate Microsoft Access From Visual Basic .NET

317114 HOW TO: Automate Microsoft Access From Visual C# .NET

Microsoft Visio

305199 HOWTO: Automate Visio with Visual Basic .NET

Microsoft MapPoint

305200 HOW TO: Automate MapPoint by Using Visual Basic. NET

302897 HOW TO: Automate the MapPoint 2002 Control and Save the Map as HTML in Visual Basic .NET

Shared Office Features

303017 HOWTO: Use Automation to Create Office Command Bars and Controls with Visual Basic .NET

303018 HOWTO: Use Automation to Create Office Command Bars and Controls with Visual C# .NET

302281 HOWTO: Obtain the Window Handle for an Office Automation Server Using Visual Basic .NET

302295 HOWTO: Obtain the Window Handle for an Office Automation Server Using Visual C# .NET

306682 HOWTO: Run Office Macros Using Automation From Visual Basic .NET

306683 HOW TO: Run Office Macros Using Automation From Visual C# .NET

303294 HOWTO: Use Automation to Get and Set Office Document Properties with Visual Basic .NET

303296 HOWTO: Use Automation to Get and Set Office Document Properties with Visual C# .NET

307292 HOWTO: Dismiss a Dialog Box Displayed by an Office Application with Visual Basic .NET

back to the top

Known Issues with Automation from Managed Code

Because the common language runtime uses a garbage collector for memory management, and because your RCW is itself a managed object, the lifetime of your Automation object is not guaranteed to end in a deterministic fashion as soon as you release your reference to it. The RCW is marked for garbage collection and is released when the garbage collector wants to free more memory. This means that although you are no longer automating an Office application, the application may stay loaded because the garbage collector has not yet freed the RCW. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

317109 PRB: Office Application Does Not Quit After Automation from Visual Studio .NET Client

For additional information about problems you may experience when you work with Office objects from managed code, click the article numbers below to view the articles in the Microsoft Knowledge Base:

315981 Visual Basic .NET '[Method] is ambiguous across the inherited interfaces' Error Message When Using Office Automation

316653 PRB: Error Using WithEvents or Delegates to Handle Excel Events from Visual Basic .NET or Visual C# .NET

320369 BUG: Old Format or Invalid Type Library Error When Automating Excel 2002

317157 PRB: Errors When You Reference the Access 10.0 Type Library with Visual Studio .NET

back to the top

4 Comments

  • Nice list... thank you for taking the time to blog it...

  • Hello every one I have used the powerpoint object libraray but i am unable to use its UI on my win form because I am unable to find its activex plzzz guide me regarding this......



    plzz let me know on this email

    doublevision_17@yahoo.com

  • This is very useful list of articles. Can you please help me to automate mail merge with word 2007? You article works just word 2003. Do you any sample code for that? Let me know on viralpatelv@yahoo.com. If you have any.

  • Dear All,

    i need help urgently, i need to create a word document from c# but i need to insert
    1-Tables and Borders
    2-images
    3-Text

    can some 1 one help?

Comments have been disabled for this content.