Solved

Blocking Rich Text Format?

Posted on 2004-09-08
2
605 Views
Last Modified: 2012-06-27
is there a way to block RTF? like these {\rtf1\ansi\ansicpg1252\deffo\deflang\1033\deflangfe1033{\fonttbl{\fo\fswiss\fprq2\fcharseto Verdana;}}{\colortbl;\red255\greeno\blueo;}\viewkind4\uc1\pard\nowidctlpar\cf1\fo\fs44 BLAH\par}, . because it messed up my colors, and since My RTB is to get text from a chatroom, people are spamming this like its a exploit.
0
Comment
Question by:andyakira
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 12015994
Is it the size that bothers you? You could monitor it and reset it to your usual size.

RichTextBox1.TextRTF = "{\rtf1\ansi\ansicpg1252\deffo\deflang\1033\deflangfe1033{\fonttbl{\fo\fswiss\fprq2\fcharseto Verdana;}}{\colortbl;\red255\greeno\blueo;}\viewkind4\uc1\pard\nowidctlpar\cf1\fo\fs44 BLAH\par}"


RichTextBox1.SelStart = 1
RichTextBox1.SelLength = Len(RichTextBox1.Text)
If IsNull(RichTextBox1.SelFontSize) Then
    RichTextBox1.SelFontSize = 8.5
End If
0
 

Author Comment

by:andyakira
ID: 12022442
that works very well but im haing a hard time to get it to work with my RTB can u assist me futher.


    For I = LBound(saElements) To UBound(saElements) Step 2
        With Form1.RTB
        .SelStart = 99999999
        .SelLength = 0
        .SelColor = saElements(I)
        .SelText = saElements(I + 1) & Left$(vbCrLf, -2 * CLng((I + 1) = UBound(saElements)))
        .SelStart = 99999999
        End With
    Next I
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question