Click to See Complete Forum and Search --> : How to Concatenate rtf documents
terryho888
Nov 10th, 2004, 04:31 PM
Hello fellow developers,
I am trying to concatenate a number of rtf documents into one singe MS Word document. Any recommendations on how to do that programmatically ?
Thanks in advance for your help !
Terence
rhbcub
Nov 13th, 2004, 07:13 PM
RTF is just a plain text file with markup -- RTF markup. Remove the last line of the first document, remove the first and last line of all the middle documents, and the first line of the last document that you append.
For example, here's a quick rtf file i made:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\colortbl ;\red255\green0\blue0;\red0\green0\blue0;}
\viewkind4\uc1\pard\b\f0\fs20 this is \cf1 a te\b0 st...\cf2 ewfop iwep ofiwopefi kwoefk\cf0\par
}
If I were to append this 2 additional copies of this, I'd remove the last curly brace form the first copy (because that tells the parser that the document has ended). I'd remove the header {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}} AND the last curly brace from the 2nd, and only the header fro mthe 3rd copy.
Devx has some pretty good rtf tutorials (http://www.devx.com/asp/Article/17964/1763/page/3)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.