### 6.16.1 Supporting more than one version of Word

If you are trying to support multiple users who have a variety of Word versions, you cannot just give them RTF files; Microsoft made sure of that. Instead, you must provide documents in .doc or .docx format.

To produce Word files in .doc or .docx format from RTF files generated by Mif2Go:

1. Load each generated RTF file into the version of Word for which Mif2Go produced it; see §6.3 Adjusting output for different versions of Word).

2. Wait until Word has counted up pages to the end, and stops; watch the counter in the status bar.

3. Select all (Ctrl+A).

4. Update fields (F9).

5. Save the file from Word as .doc (or .docx for Word 2007 and later versions).

Automate the process

Or, you can create a Word VBA macro that will do all that for you. In Mif2Go you would use a SystemEndCommand (see §34.4.1 Specifying system commands) to open RTF files in Word and invoke a Word macro like the following macro for .doc output:

Sub LoadRtfFile()

'

' LoadRtf2007 Macro

' Macro recorded 5/31/2010 by Omni Systems

'

Dim nameStr As String

Selection.WholeStory

Selection.Fields.Update

nameStr = Replace(ActiveDocument.FullName, ".rtf", ".doc")

ActiveDocument.SaveAs FileFormat:=wdFormatDocument, _

FileName:=nameStr, LockComments:=False

Selection.StartOf

End Sub

See the Word VBA reference for details. Word files in .doc or .docx format can be distributed to users who have any version of Word.

The value of SystemEndCommand would look like this:

path/to/winword.exe /mLoadRtfFile path/to/<$$_basename>.rtf

| 6.16 Managing Word output after conversion |  | 6.16.2 Including index terms in Word |