Share via


Distributing Code Samples with the Code Librarian Viewer

The Code Librarian makes it easy to create libraries of sample code. The Code Librarian Viewer is provided as a redistributable read-only run-time version of the Code Librarian. By distributing the Code Librarian Viewer, your users can browse any code library created using the Code Librarian.

The Code Librarian Viewer makes it possible for users to search for code and copy it to their own projects. Because it is read-only, however, users will not be able to modify, add, or delete items using the Code Librarian Viewer.

Note   You can use Microsoft Access to compress the code library database (.clb file) to reduce the size of the file. For details, see the Access online documentation.

To view a library using the Code Librarian Viewer

  1. From the Start menu, point to Programs, then Microsoft Office XP Developer, and then Code Librarian Viewer.

    **Note   **The first time the Code Librarian Viewer is launched, there is no database attached. You must first add a database before you can use the Code Librarian Viewer.

  2. From the File menu, select Open.

  3. In the Open dialog box, browse to the location of the code librarian database you want to open and click OK.

The library is opened in the Viewer.

To distribute a library with the Code Librarian Viewer

  1. Create a code library using the Code Librarian in the Microsoft Development Environment. For details, see Creating a Code Library.
  2. Enter the categories, code snippets, and keywords as desired.
  3. Close the code library.
  4. Launch the Packaging Wizard. For details about the wizard, see Packaging Wizard.
  5. In the Identify Application and Package screen, select the code librarian file (.clb) as the main file for the package.
  6. In the Dependencies screen, click Add File.
  7. Browse to the location of the Code Librarian Viewer file (codelibviewer.exe) and add the file to your package. This file is installed by default to \Program Files\Microsoft Office Developer\CodeLibrarian.
  8. Continue with the wizard.

The Packaging Wizard will create a setup program that will install your code library and the Code Librarian Viewer on your user's computer.

See Also

Using the Code Librarian | Opening the Code Librarian | Creating Code Librarian Categories | Creating a Code Library | Customizing Code in the Code Librarian | Associating Keywords with a Code Item | Creating a Setup Package Using the Packaging Wizard