Omni Systems, Inc. |  | Mif2Go User's Guide, Version 55 |  |  |  |  |

> 28 Working with macros > 28.2 Accessing Mif2Go macro libraries > 28.2.4 Including macro definitions in your own macro library > 28.2.4.1 Creating a macro library

#### 28.2.4.1 Creating a macro library

To create your own macro library:

1. Create a new text file for your macro library. Give the file extension .ini, and either place it in your project directory or specify an absolute path to its location. It is a good idea to use the same location for macro library files for all your Mif2Go projects.

2. Add macro definitions to the file, each in its own section, as described in §28.1.1 Defining macros.

3. Put a non-macro dummy section at the end of the file; for example:

[End]

Otherwise, the last macro in the library might cause an extra character to be included in output.

4. Make your library file reference m2rtf_macros.ini or m2htm_macros.ini, and make your project configuration file reference your library file. For example, suppose you create a text file called MyMacros.ini, and place it in D:\MacroLibs.

In MyMacros.ini:

[Templates]

Macros = %OMSYSHOME%\m2g\m2htm_macro.ini

In your project configuration file:

[Templates]

Macros = D:\MacroLibs\MyMacros.ini

If you omit a path, Mif2Go looks for MyMacros.ini in your project directory.

Because MyMacros.ini is closer to your project configuration file in the chain of macro libraries, your macro definitions take precedence over any definitions of the same macros further away from your project configuration file in the chain.

Default macro library

If you do not specify a value for Macros, and you invoke a macro that is not defined in your project configuration file, Mif2Go looks in %OMSYSHOME%\m2g\macros for a file named m2htm_macros.ini or m2rtf_macros.ini.

> 28 Working with macros > 28.2 Accessing Mif2Go macro libraries > 28.2.4 Including macro definitions in your own macro library > 28.2.4.1 Creating a macro library

| Mif2Go User's Guide: 28.2.4 Including macro definitions in your own macro library |  | Mif2Go User's Guide: 28.2.4.2 Creating a file-specific macro library |