Creating Rich Text Format files from a Server.
  by Bruce Knox  bknox @t     Oracle Database Programmer/Analyst Copyright 2009last updated 02/13/14               

Formatting Documents from Oracle or UNIX:

You can do a mail merge on the Server by concatenating a Rich Text Format (.rtf)  header, the plain text address, and a .rtf footer.  The .rtf file is plain text that includes formatting and font control.  This works for email attachments as well and is a good answer for sending messages from an Oracle database such as SCT's Banner to clients that otherwise would not respect the formatting intended by the sender.

Just save a standard letter in .rtf by “Save as Type Rich Text Format (.rtf)”.  Then using a simple editor such as Notepad break the document into two parts.  The header will look something like:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fmodern\fprq1\fcharset0 Courier New;}{\f1\fswiss\fcharset0 Arial;}}


The footer will look something like:

text of the letter



If you just insert the plain text “label content”, save the file and then open it in Word or WordPerfect, the plain text will now have the font selection and other characteristics of the original letter.

So, you can create a single file including the address and letter using the Font, Font Style, and Size in your plain ASCII text file from Oracle.  When the user opens the file in their word processor program, the letter will have everything formatted correctly and ready to print.

If the users have changed their minds about the Font, they have full control to make changes to the entire file.

see for sending UNIX mail with attachments.


Use this information and these scripts at your own risk. As a condition of using these scripts and information from this site, you agree to hold harmless both the University of Arkansas Cooperative Extension Service and Bruce Knox for any problems that they may cause or other situations that may arise from their use, and that neither the Extension Service nor I will be held liable for those consequences.  The scripts and information are provided "as is" without warranty, implied or otherwise.  Limitation of liability will be the amount paid to the University of Arkansas specifically for this information. (It was free:) is my personal site.  betwinx?  This site is largely oriented to Oracle Reporting Solutions in the context of generating bespoken reports from Ellucian's Banner product. 
(I maintain a number of special topic pages with links from this primary site.)
View Bruce Knox's profile on LinkedIn