Sharing Code using the Code Librarian
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
With the Code Librarian, you can view the code in the database and insert the code directly into one of your class modules.
Searching for Code in the Code Librarian
Inserting Code into your Project from the Code Librarian
To share code between multiple developers, place a Code Librarian database on a network share where each developer can access it. To view the code, each developer need only open the .mdb file.
Note When you first start Code Librarian, you'll need to open the Codelib.mdb file to view all of the code snippets included with Office 2000 Developer. This database is located in Office 2000 Developer directory at ..\Microsoft Office\ODETools\V9\CodeLib.mdb.
You can also create additional database files to store code.
Searching for Code in the Code Librarian
Because the code snippets in the Code Librarian are annotated with keywords and organized by categories, there are three ways to find source code: contents listing, keywords, and full-text search.
Contents Listing
The Contents tab contains a list of the categories of available source code.
To find code using the Contents tab
In the Code Librarian, select the Contents tab.
In the Contents window, click the desired category. The list of available source code snippets for the category is displayed in the Code box.
****Note ****Click the plus sign next to the category name to expand the list of subcategories.
In the Code box, select the desired code snippet to display the source code description and input/output parameters. Double-click the desired code item in the Code box to view the source code.
****Note ****Right-click the code snippet for additional commands.
Keywords
The Keywords tab contains an index of keywords associated with all of the code in the library.
To find code using keywords
In the Code Librarian, select the Keywords tab.
Enter a keyword in the Type in the keyword to find box. The list scrolls to the nearest matching keyword.
Double-click the keyword to view a list of all associated code snippets.
Double-click the desired code item in the Code box to view the source code.
****Note ****Right-click the code snippet for additional commands.
Full-Text Search
The Search tab contains a full-text search of the actual code (or just the titles) in the library.
To find code using full-text search
In the Code Librarian, select the Search tab.
Enter the text to search for in the Type in the word(s) to search for box.
If desired, click the arrow next to the text box to choose from the Boolean operators AND, OR, and NOT.
From the Search Options section, choose Search titles only or Search through code.
Click Search. All code snippets meeting the search criteria are listed in the Code box.
Double-click the desired code item in the Code box to view the source code.
****Note ****Right-click the code snippet for additional commands.
Inserting Code into your Project from the Code Librarian
Once you have found the code snippet you wish to use, you can easily insert it in your code module by dragging it onto your code module or by copying the code to the Clipboard and pasting it into the code module.
To drag code from the Code Librarian into an existing code module
In the Code Librarian, select the code snippet you wish to use.
Double-click the code item to view the code.
On the Code tab, select the code you wish to use.
Using the mouse, drag the selected code from the Code tab to the location in your code module.
When you release the mouse, the selected code is inserted in the location.
To insert code from the Code Librarian into your module
In your code module, place the cursor in the location where you want to insert the code.
In the Code Librarian, select the code snippet you wish to use.
Right-click the code item, and select Insert in Module.
-or-
Select the code item, and click the Insert Code to Module toolbar button.
The code from the Code Librarian is inserted in your code module.