troubleshooting Question

Richtextbox colour

Avatar of wildarmsdave
wildarmsdave asked on
Visual Basic Classic
6 Comments1 Solution1476 ViewsLast Modified:
Hi. I have a 'messenger system' for work. Basically, the admin PC's append information to a text file on the network (newest text to the top) and the shop floor client PC's load and display this information on screen every minute (if there are any changes to the text file.)

I now have a requirement to have coloured text on the screen. When the admin PC's append to the text file, the data is now saved in .rtf format. The client PC's load the text and display it in .RTF format. This works fine. However, there is a problem....

If I send this.....it works fine....

AAAAA (text in blue)
BBBBBB (text in red)
CCCCC (text in green)

If I send this...

AAAAA (text in blue)
then send
BBBBBB (text in red)
then send
CCCCC (text in green)

..... only CCCCC (the text added last) appears on the client PC.

All the text is appended to the text file if I view it with notepad. However, If I open up the text file in word pad or MS Word, then the same thing happens (only CCCCC shows up.)

This is obviously being caused when I am appending the text to the text file and is something to do with the .RTF codes contained in it (see below.) Any ideas how I can get round this?

Working

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;\red0\green255\blue0;}
\viewkind4\uc1\pard\cf1\b\f0\fs24 AAAAAAAA\cf0
\par \cf2 BBBBBBBBB\cf0
\par \cf3 CCCCCCCCC\cf0
\par }

Only Displays top line..

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
{\colortbl ;\red0\green255\blue0;}
\viewkind4\uc1\pard\cf1\b\f0\fs24 CCCCCC\cf0
\par }

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\cf1\b\f0\fs24 BBBBBB\cf0
\par }

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
{\colortbl ;\red255\green0\blue0;}
\viewkind4\uc1\pard\cf1\b\f0\fs24 AAAAAA\cf0
\par }








Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros