Tips for editing your style files with Microsoft Access

By Charlie Frye, Esri Chief Cartographer

The style files that are installed with ArcMap are actually Microsoft Access databases, the file extension was changed from .mdb to .style.  Based on this knowledge, we’ll describe a few useful things you can do to edit your style files using Microsoft Access. These tasks are either not possible or a bit tedious to accomplish easily in ArcMap.

First you’ll need to open your style with Microsoft Access. To do that, launch Microsoft Access, from the file menu choose Open, and in the File Name box, type “*.style”.  Then browse to where your styles are located.  Choose a style file and open it.

Changing the sort order of the contents of a style folder:

The order that symbols or elements appear in a style folder is determined by the primary key field, which is something you can use Microsoft Access to change. There are a number of reasons you may wish to do this, for instance, you may not find an alphabetically ordered list of symbols useful. Instead you may want the symbols sorted according to a specific taxonomy, chronologically, or simply with your favorites on top.  Here is how to use Microsoft Access to change the sort order:

  1. If you have not already done so, open the style file in Microsoft Access
  2. In the list of tables, double-click on the table (named after the style folder) containing the symbols you want to sort differently.
  3. You can either add a new field and data to sort by, or use the ID field, usually a long integer field in either case. Once you have that field with its values, sort it to verify that’s the order you want the symbols to appear.
  4. Switch to design view, change that field to be the primary key (see below).
    Tips Editing Microsoft - Figure 1
  5. Save the .style file.

Set the category for more than one symbol at a time

Categories in styles are probably under-used because editing them in ArcMap is tedious, especially for large styles where categories would be most needed. Categories are very useful in the Symbol Selector dialogs because they make it possible to sift through potentially hundreds of symbols quickly.

Tips Editing Microsoft - Figure 2
By selecting a category the list of symbols is limited to just those for that category.

Here is a trick to efficiently edit categories in Microsoft Access:

  1. Open the .style file in Microsoft Access
  2. In the list of tables, double-click on the table (named after the style folder)  that contains the symbols you want to assign categories to.
  3. The trick is based on the idea that you can select, copy, and paste a multi-cell area in Microsoft Access.  Let’s say you’re starting with a blank Categories column, here is how to make efficient work of assigning categories:
    1. In the Categories column, type the category name in the first record.
    2. Select that cell, click Ctrl-C to copy it and then click the cell in the in the 2nd record in the Categories column and click Ctrl-V to paste.
    3. Now in the categories column select a vertical range (of two cells) by clicking in the first cell and then Shift-clicking in the second cell.
    4. Click Ctrl-C to copy the range.
    5. Now select an empty range of two cells in the categories column and click Ctrl-V to paste.
    6. Now select the four cells with values and copy and paste the values into the next four cells. Here’s what that might look like as you edit:
      Tips Editing Microsoft - Figure 3
    7. Continue in this fashion.  When you’re close to the end, copy a range of cells that has at least as many cells as your remaining records (copying more won’t cause a problem).  Then select the remaining cells and click Ctrl-V.
  4. Save the .style file.

Getting rid of style Bloat

If you’ve got a style that you’ve customized from time to time, or one you work on quite frequently, it’s likely that you’ve got a case of “style bloat”.  All those changes or are stored inside the .style file in a table you cannot see or work with, even in Microsoft Access.  But, just like you have the ability to compact your personal geodatabases, you can compact your style files.  To compact your style file, follow these steps:

  1. Open the .style file in Microsoft Access
  2. From the Tools menu select Database Utilities, which will open a sub-menu.
  3. Select “Compact and Repair Database” from that sub-menu.
  4. Save the .style.

It’s always a good idea to get rid of the style bloat before you share your style.  Some style files are quite large and when bloated may be prohibitive in terms of sending via email to your colleagues.  We’ve seen the size of some style files reduced by as much as 80%, making them much easier to share and friendlier to your hard disk.

This entry was posted in Mapping and tagged . Bookmark the permalink.

Leave a Reply

One Comment

  1. krazy17 says:

    To compact and repair in Access 2007:
    1. Click on the Office Button
    2. Choose Manage, then Compact and Repair Database