Appendix A. Creating Code Snippets

Both Visual Basic 2005 and VSTO ship with a number of code snippets you can use in your code. You can also create your own snippets. This appendix shows you how to create a simple XML code snippet that adds a control to the actions pane.

You can use a code snippet editor tool to produce the code snippets, or you can write the code snippet XML file. To download Microsoft’s Code Snippet Editor from the Microsoft Visual Basic Developer Center, search for “Code Snippet Editor for Visual Basic 2005.” However, for the following example, you’ll add XML tags to a file by hand.

  1. Create a new text file in Notepad, and then add the XML markup from Listing A.1 to the file.

    Listing A.1. An XML code snippet that adds a control ...

Get VSTO for Mere Mortals™: A VBA Developer’s Guide to Microsoft Office Development Using Visual Studio 2005 Tools for Office now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.