Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

VB Word Processor Problem!! HELP!

if i put content like this below into the richtextbox
 
content
 
more
 
and more
 
and put a bullet on the line "more" by doing this

richtextbox.selbullet = true

and copy and paste all three lines, throughout the document a weird character that looks like an unbolded bullet appears after the line "more". Any ideas how this could be fixed?

Thanks for any help
0
jmingo
Asked:
jmingo
  • 2
1 Solution
 
BurbbleCommented:
Ok, I've been looking into this for a while now, and I still don't have a definite solution...Here's what I've got so far:

When you copy and paste the text as you described, it adds

Chr$(183) & Chr$(9)

to the beginning of the line below the bulleted line. This corresponds to RTF:

\'b7\tab

(I think)

So my solution was to do this:

Private Sub RichTextBox1_Change()
    Dim lngSelStart As Long
    lngSelStart = RichTextBox1.SelStart
    'RichTextBox1.Text = Replace(RichTextBox1.Text, Chr$(183) & Chr$(9), "")
    RichTextBox1.TextRTF = Replace(RichTextBox1.TextRTF, "\'b7\tab", "")
    RichTextBox1.SelStart = lngSelStart
End Sub

Neither way works. The second one just makes the problem occur without copying and pasting (although the format of the Replace()'d text is correct, setting the RichTextBox contents to it does not seem to work correctly).

I'm thinking that this is a bug in the RichTextBox which may not be (easily) correctable...

Hmm.. I leave this open to other Experts for any more ideas ? I'm all out
0
 
jmingoAuthor Commented:
yeah i've been looking into this too... and i can't seem to figure it out...

i print the rtf codes into a textbox and it still displays \'b7\tab's after i replace them. weird!!

Private Sub RichTextBox2_Change()

lngSelStart = RichTextBox2.SelStart    
RichTextBox2.TextRTF = Replace(RichTextBox2.TextRTF, "\'b7\tab", "")
RichTextBox2.SelStart = lngSelStart
Text1.Text = RichTextBox2.TextRTF

End Sub

i think it is a bug. there is a free richtext control on vbaccelator, that doesn't do this... i may have to look into that.


any other thoughts??? thanks for your help.
0
 
BurbbleCommented:
The only reason to keep the question PAQ'd (refund the points of course) would be to advise others who may come across the same problem that it cannot (apparently) be fixed, and is in fact an inherent problem of the Rich Text Box control.
0
 
PAQ_ManCommented:
PAQed with points refunded (25)

PAQ_Man
Community Support Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now