Chapter 12
Microsoft Office Integration
WHAT YOU WILL LEARN IN THIS CHAPTER
- Exporting your application’s data to a Microsoft Excel worksheet
- Understanding Office automation
- Creating LightSwitch methods that use Office automation
- Discovering the automation object model with macros
Visual Studio LightSwitch has been designed with Microsoft Office integration in mind. That means you can export your lists and tables to an Excel worksheet without writing any code. The automation features of Office applications make it easy to use Word, Excel, Outlook, or even PowerPoint from LightSwitch, but these tasks require writing code.
In this chapter you will learn how to use these integration features.
EXPORTING DATA TO MICROSOFT EXCEL
LightSwitch makes it extremely easy to utilize Microsoft Excel. With a simple click, you can export data to an Excel worksheet, as you will learn from the following exercise.
TRY IT OUT: Exporting Data to Microsoft Excel
NOTE In this exercise, you continue the sample that you completed in Chapter 11. You can find the starting sample on this book’s companion website at www.wrox.com in the folder Chapter 12\Start.
To export a list of projects to Microsoft Excel, follow these steps:
1. Open Visual Studio LightSwitch and load the ProjectTrek solution.
2. Run the application by pressing Ctrl+F5. After it is launched, open the ConsulArt Projects screen.
3. In ...