This demonstration shows you how to automate Office from .NET.
This application has three demonstrations involving the following Office components. When referencing the various COM Office assemblies, Visual Studio .NET automatically creates COM runtime callable wrappers (RCW) so you can program against them from within .NET. This application shows you how to work with:
1. Microsoft Agent: Learn how to make Merlin appear in your applications and do things like speak, move, and show off his various animations. Merlin and the other Office Agent characters are an excellent way to provide Help and other assistance to users of your application.
2. Microsoft Word: Learn how to create a Word application and call the spell checker to check a document loaded into a RichTextBox control. 3. Microsoft Excel: Learn how to create and fill a DataSet from an XML document and then databind it to a DataGrid. Then export the contents of the DataSet to an Excel spreadsheet and run an Excel function that calculates the average of values in a column.Microsoft Agent: Learn how to make Merlin appear in your applications and do things like speak, move, and show off his various animations. Merlin and the other Office Agent characters are an excellent way to provide Help and other assistance to users of your application. For more on Microsoft Agent see the articles and SDK documentation at http://msdn.microsoft.com. 2. Microsoft Word: Learn how to create a Word application and call the spell checker to check a document loaded into a RichTextBox control.
3. Microsoft Excel: Learn how to create and fill a DataSet from an XML document and then databind it to a DataGrid. Then export the contents of the DataSet to an Excel spreadsheet and run an Excel function that calculates the average of values in a column.
Microsoft Visual Studio.NET Professional or greater.
Windows 2000 or Windows XP.
If you want to hear Merlin speak, you may need to install the speech recognition
pack, which is included with Microsoft Office XP but not installed by default.
For instructions on how to do this see:
http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/winxppro/proddocs/input_speech_install.asp
Depending on your Office installation configuration, the Office references may not be valid in the project. To update the references:
Press F5 to run the sample.
For more on Microsoft Agent see the articles and SDK documentation at
http://msdn.microsoft.com. A good place to start is:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_msagent-i.asp.