#### 28.1.1.8 Obtaining RTF code for macro definitions

RTF coding is arcane, especially for tables. Unless you are an RTF expert, your best bet might be to copy existing RTF code. Here are some ways to obtain RTF code for your macros:

Get code examples from Word

Get code examples from Mif2Go

Generate RTF code with Mif2Go.

Get code examples from Word

You can pretty-print RTF output from Word to mine for code (if you open a Word RTF file directly in a text editor, you see only unbroken lines of unreadable code):

1. In Word, create an example of the output you want.

2. Save as RTF from Word.

3. At a Windows command prompt, run pretty-printer program pprtf.exe on the saved RTF. The pprtf.exe program is included in your Mif2Go distribution directory.

The RTF pretty-printer, pprtf.exe, takes either one or two arguments:

• the name of the RTF file, with extension

• optionally, a different name for the output file, with extension

and creates a new file:

pprtf ExampleFile.rtf NewFile.txt

If you omit the second argument, the output is a file of the same name as the RTF file, but with extension .txt.

Get code examples from Mif2Go

Another way to obtain RTF code is to create an example in FrameMaker, run Mif2Go, and then copy/paste the resulting RTF code into your m2rtf.ini configuration file or into a macro library file. Mif2Go produces RTF output that is even more readable than the output from pprtf.exe.

Generate RTF code with Mif2Go

For paragraphs, you can use CodeStore to generate RTF code; see §28.3.7.2 Inserting code with the CodeStore property.

| 28.1.1.7 Converting “smart quotes” in macro definitions |  | 28.1.2 Invoking a macro |