Instructions for Installing and Running the
"Tags" Macro

Version 2.0 Release

by Alan W. Gomes, Ph.D.
Talbot School of Theology

November 3, 1995

Description of the "Tags" Macro

The "tags" macro allows you to use a Microsoft Word file containing research notes as a kind of text database. The information in the file does not have to be formatted in any particular way, other than marking the beginning of each entry with a descriptive or numbered "tag," and designating the end of the entry with a page break. (The procedure for delimiting "card file" entries is discussed below.) When run, the macro will prompt you for a tag name/number, which the macro will use to extract the desired entries from your file of notes. Entries matching the tag will be copied and placed in a new file. In other words, the macro creates a smaller file which is a subset of your complete notes file; the subset file contains only the portion of your larger file that matches the value of the tag. For example, if you have a large file containing many sermon illustrations, you could have the tags macro go through and extract only those quotations dealing with justification by faith.

Installing the Tags Macro

Microsoft Word 6.0 stores macros in templates. The tags macro is stored in a template named "TAGS.DOT" (included). The macro in this template is compatible both with the Windows and with the Macintosh versions of Word 6.0.

To install the macro, you will use the style "organizer" to copy the TAGS macro from the TAGS.DOT template to your NORMAL.DOT (Windows) or NORMAL (Macintosh) template. Macros located in the NORMAL template are available for use in all documents all of the time.

To install the macro, follow these steps:

    1. Insert the disk containing the TAGS.DOT template.
    2. From the "Format" menu (i.e., see the menu bar at the top of the screen) select "Style."
    3. Choose "Organizer."
    4. Select the "Macros" tab to display options for working with macros.
    5. Select the "Close File" button on the left side of the screen. The button will then read "Open File."
    6. Select the "Open File" button.
    7. Select the (previously inserted) disk containing the TAGS.DOT template.
    8. Highlight the TAGS.DOT file and select "Open."
    9. Immediately above the dialog box on the left should be the words "In TAGS.DOT," and the word "Tags" should appear highlighted in the dialog box itself. (If for some reason it is not highlighted, select it using the mouse; simply point at the word "Tags" and click once.) The dialog box on the right should read "To Normal," and may or may not display the names of other macros (i.e., those already contained in the Normal template).
    10. Press "Copy" to copy the Tags macro from the TAGS.DOT template (shown on the left) into the Normal template (shown on the right). The Tags macro is now installed and available.
    11. To run the macro, consult the steps described in the section entitled "Running the Tags Macro," given below.

Adding the Tags Macro as a Menu Selection (Optional)

Microsoft Word 6.0 allows you to make macros available as commands that you can select from one of its menus at the top of the screen. By installing a macro as a regular menu command, you can have ready access to the Tags macro; you can run it simply by pulling down the appropriate menu and selecting the Tags command, just as you would select any other Word option or command. Note that it is not necessary to install the macro in this way; you can still run it from the "Tools|Macro" menu. However, if you plan to use this macro often, I recommend that you make it a permanent menu option.

I suggest that you add the Tags macro to your "Tools" menu. To do so, perform the following steps:

    1. Make certain that you have already installed the Tags macro to your normal template (see instructions in the previous section).
    2. Select the "Tools" menu, then choose "Customize."
    3. Select the "Menus" tab.
    4. Under "Categories" (the left-most dialog box), scroll down until you see "Macros." Select (i.e., highlight) "Macros."
    5. In the right-most dialog box you should now see a list of all available macros in the normal template. Scroll down until you see the word "Tags." Select (i.e., highlight) "Tags."
    6. Under "Change What Menu," make sure it reads "&Tools" (assuming, of course, that you wish to add this command to your Tools menu, as opposed to some other menu). For "Position on Menu," you can leave it set to "(Auto)" if you wish the command to be placed at the bottom of the Tools menu, or you may select another position on the Tools menu by selecting the drop-down dialog box. (Note that if you select another position via the drop-down box, the Tags command will be added immediately below the selected command).
    7. Press "Add" (or "Add Below") to add the Tags command to your Tools menu.
    8. Close the dialog box to return to the main Word editing screen.
    9. Confirm that the installation was successful by selecting the "Tools" menu. You should see a newly added command: "Tags." You may now run the Tags macro at any time simply by selecting the "Tools" menu and choosing "Tags."

Setting up "Card File" Entries

The tags macro expects to see entries delimited by a hard page break. (A "hard page break" is a page break that you manually insert, as opposed to a "soft" page break, which occurs as the text you type naturally flows from the bottom of one page to the top of the next.) In other words, an entry (i.e., a record) consists of all the text between at the page break at the top of the first page of an entry up to the next hard page break; the entry is all the text between these hard page break boundaries. In Microsoft Word 6.0, a hard page break may inserted in one of two ways: (1) From the "Insert" menu on the menu bar at the top of the screen, select "Break," and then select "Page break." (2) Press "control-enter" (under Windows) or "Apple key-enter" (Macintosh).

Tags should be listed on the first line or lines of each card file entry. Without the tag, the macro would not have any way of determining whether to select the entry. Note that you may have multiple tags for any particular entry. A sample entry might be as follows:

[The entry begins with a hard page break...]

[15]--Anglo-Israelism in the Worldwide Church
[12]--Lost "truths" supposedly restored by Armstrong

Herbert W. Armstrong considered the identity of the Israelite people to be of utmost importance. He claimed that one of the eighteen great truths God restored through his ministry was that the United States, Britain and the nations of Europe are the descendants of the Lost Ten Tribes of Israel.

[The entry ends with a hard page break...]

[Next entry begins here...]

Now, you may be wondering why I have both a descriptive label and a number in square brackets as part of the tag. Actually, the macro will work fine with the descriptive label alone or the number alone. In practice, I have found it best to use a unique number in square brackets for each topic and then have the tags macro pull up the entry based on it. The descriptive label is added simply to aid readability as you are reading through your notes file. There are several reasons for using both a unique number and a plain English description:

    1. Because computers are mindlessly literal, if you varied even slightly the wording or spelling of a tag from one entry to the next, the macro would fail to find the deviant entry. A number in square brackets is easier to type accurately.
    2. The macro searches the entire text of your file and will consider any string of letters and numbers that matches what it is looking for to be the "tag." Thus, if you created a tag that simply read "Easter," the macro would consider any place in the file containing the word "Easter" to be a "hit," when in fact you might not want it to be. On the other hand, by making the tag something like "[10]--Easter" and then searching for "[10]," it would find only the desired entries.
    3. Although you could work only with numerical values in square brackets and avoid altogether the English description of the tag, the English description allows you to see at a glance how a particular entry has been classified--even though the tags macro itself does not need the description to function.
    4. As for the square brackets around the number, this is necessary to keep the macro from selecting entries containing the same number in the body of the text itself. For example, if you used "10" as the tag (without the square brackets around it), it would pull all entries containing the number 10, even if the "10" in the entry referred to a page number or the like.

Running the "Tags" Macro

Before running the TAGS macro, you must close all windows besides the window containing the notes file you wish to search. Then create a new, blank file in a new window. If you have too many or too few windows opened, the macro will put up and error message and ask you to set the appropriate number of windows before trying again.

Switch to your master notes file and then run the macro. When the macro runs, the entries selected from your master notes file will fill up the blank file. Note that once the macro has finished its work, the newly created file must be given a name and saved if you wish to retain permanently the information contained in it. Your original, master notes file is left unchanged.

The macro will also work if the file you have opened in the other window is not blank. In that case, the entries selected from your master notes file will be added to the other file.

Again, it is important that the master notes file is the currently displayed window before executing the macro. You need not worry about scrolling to the top of the file before running the macro: the macro will automatically position the cursor to the top of the file to insure that all entries are searched.

If you added the macro to your "Tools" menu (see above), you may run it simply by selecting "Tools" and then "Tags." If you have not added the macro to your Tools menu, then to run the macro you must select the "Tools" menu and choose "Macro." You will see a list of available macros. Select "TAGS" and then select "Run" to run the macro. The macro will prompt you to enter the desired tag. After entering the desired information, press "OK" and it will begin its work. When the macro has finished, it will beep and notify you that it is through.

Let me know how you like it.

Alan Gomes