Bruce Knox Database Programmer/Analyst date last updated 04/19/09
Creating Rich Text Format files from a server.
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;}}
\viewkind4\uc1\pard\f0\fs20
The footer will look something like:
text of the letter
\f1\par
}
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.
Disclaimer
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:)
visits
http://www.uaex.edu/bknox/formatted_documents_from_oracle_or_unix.htm
mirror