Solved

Blocking Rich Text Format?

Posted on 2004-09-08
2
591 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

685 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