More WS7 to RTF

The following version of the macro to convert to WinWordRTF takes advantage of a Win9x feature which permits one to start a Windows program from the WS7 command/run line.

The following two illustrations are for WordPad and the Microsoft Word Viewer.  The macro now provides a name in the Temp folder for the temporary RTF created.  After the temporary files are deleted the macro then opens the RTF file in the designated Windows Program.  You can add your own program of choice can be added.

I chose WordPad and WordViewer because both are free and common. WordPad permits one to edit the file, while WordViewer handles formatting better especially footnotes.  My test file for conversion was an academic article in two languages with 80 footnotes.

This by the way provides a means of basic printing with brain dead printers.  Convert to RTF and open it in WordViewer to print.
 

===============

Sub Main
     AutoRestore(ON)
     SetHelpLevel(4)
     Insert(ON)
     CmdTags(OFF)
     HideDots(ON)
     ColMode(OFF)
     ColReplace(OFF)
     Key("{Ctrl+K}t")
     IfException
     QRY: Key("c:\temp\rtftemp.ws{Enter}")
     End IfException
     PauseForInput("{F10}", 'F10 to convert')
     Key("lc:\ws\convert{Enter}")
     Key("r")

     Key("convert -i=c:\temp\rtftemp.ws -o=c:\temp\wstemp.rtf -c=WS5,RTF{Enter}")
     PauseForInput("{F10}", 'F10 to copy')
     Key("o")
     Key("c:\temp\wstemp.rtf{Tab}")
     Key("c:\temp\wordpad.rtf{Enter}")
     PauseForInput("{F10}", 'F10 to clean')
     Key("y")
     Key("c:\temp\rtftemp.ws{Enter}")
     IfException
     ACK: Key("{Enter}")
     End IfException
     Key("y")
     Key("c:\temp\wstemp.rtf{Enter}")
     IfException
     ACK: Key("{Enter}")
     End IfException
     PauseForInput("{F10}", 'F10 for WordPad')
     Key("r")
     Key("c:\progra~1\access~1\wordpad.exe c:\temp\wordpad.rtf{Enter}")
End Sub
 

===================

Sub Main
     AutoRestore(ON)
     SetHelpLevel(4)
     Insert(ON)
     CmdTags(OFF)
     HideDots(ON)
     ColMode(OFF)
     ColReplace(OFF)
     Key("{Ctrl+K}t")
     IfException
     QRY: Key("c:\temp\rtftemp.ws{Enter}")
     End IfException
     PauseForInput("{F10}", 'F10 to convert')
     Key("lc:\ws\convert{Enter}")
     Key("r")
 
 
 

Key("convert -i=c:\temp\rtftemp.ws -o=c:\temp\wstemp.rtf -c=WS5,RTF{Enter}")
     PauseForInput("{F10}", 'F10 to copy')
     Key("o")
     Key("c:\temp\wstemp.rtf{Tab}")
     Key("c:\temp\wordview.rtf{Enter}")
     PauseForInput("{F10}", 'F10 to clean')
     Key("y")
     Key("c:\temp\rtftemp.ws{Enter}")
     IfException
     ACK: Key("{Enter}")
     End IfException
     Key("y")
     Key("c:\temp\wstemp.rtf{Enter}")
     IfException
     ACK: Key("{Enter}")
     End IfException
     PauseForInput("{F10}", 'F10 for WordView')
     Key("r")
     Key("c:\progra~1\wordview\wordview.exe c:\temp\wordview.rtf{Enter}")
End Sub