Problem with Lebans RTF2 bulleted lists

  • Thread starter Thread starter Bas van der Doorn
  • Start date Start date
B

Bas van der Doorn

Hello,

I am trying to use the RTF code from a RTF2 1.8 control in a Word document
after exporting it through an Access report and clearing the RTF header and
other Access export garbage with a script. The issues below are not caused
by this however, as they can be reproduced by copying the RTF code in the
Access table to a textfile and renaming it to RTF. Word has one problem
reading bulleted lists created by RTF2 version 1.8:

- The biggest problem with a bulleted list is that it is closed by
\line\pard\par, which WordPad can read correctly, but Word XP cannot. The
solution I have found to this probem is using \line\par\pard, which
interchanges \par and \pard. Now both Word and Wordpad can read it
correctly.

The next 'problem' is a result of my usage of the RTF2 control. I hope it
will be acknowledged however.
The last item of the bulleted list is closed with \line\pard\par (or
\line\par\pard after fix) and immediately (without whitespace) followed by
the next textline (I know that there is a newline character in between when
RTF2 saves it). This happens not when copying the RTF text, but only when
exporting it through an Access report, which unfortunatly deletes the
end-of-line character when exporting the RTF code. This results in the first
word of the following sentence not being displayed properly in word.
Inserting one space character after each \pard (if fix above is applied)
would also solve this problem for me. Since the space character would be
between the markup code, it should not have any impact on compatibility or
the displayed text at all. I fully understand if this white space is not
welcome and will not be implemented though. I can always expand my own
script to search for \pard (or \par) and insert one space character behind
it.

Could mister Lebans please shed some light on this situation and hopefully
come up with a fix for at least the first problem above?

Thank you very much,

Bas
 
Sorry, I am currently on vacation until September and realistically,
there is absolutely nothing I can do to fix your issue anyway. The RTF2
control is created directly from the same DLL that Wordpad and MS Word
both use. Any incompatability via roundtripping you are experiencing is
internal to MS Word.

Have you tried simply loading the exported RTf doc into Wordpad and then
using Worpad to save it back out to see if you have better
compatability?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
I have created an Access script that fixes this problem for me. I use an
Access report, with a normal textbox to list the RTF code generated by your
control. I have created a form that will export this report to RTF and do
some post-processing. This will incorporate your RTF code into the Access
RTF code, making one complete report with RTF text as input in Access.
I have to open and parse through the export file anyway, as Access cannot
output your RTF code in a way that the markup code functionally appears in
an RTF export document. So it is not such a big problem for me to include
some other 'fixes' as well. By now most nasty bugs are gone. All generator
and additional colortbl and rtf1 sections are correctly deleted from the
output file. In addition all the escape codes and newlines inserted by the
Access report function are automatically deleted. Besides this, all cf1
references are reset to cf0, so all black or white text from your control
and the Access report itself will become black in the outputfile (I only
need black text and before this fix text from your RTF control was white in
the outputfile). If you want a copy of the script just e-mail me, as I do
not visit newsgroups often.
Thanks for the very nice RTF control you have written, it really works
better than I could have ever imagined. Pleasant vacation!
 
I would like to be able to post your code on the RTF2 Web site page.
Please send me a copy!
:-)

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top