Solved

Replacing Lines of a RichTextBox

Posted on 1998-08-07
1
141 Views
Last Modified: 2010-04-30
Hi, does anyone know how to replace an entire line by specifying the line number and the string of a RichTextBox?
Thanx
0
Comment
Question by:captain_needa
1 Comment
 
LVL 1

Accepted Solution

by:
BlackAndWhite earned 100 total points
ID: 1468298
You maynot be able to do that by line numbers.  The line number of a statement in the richtext box is not the same as the real line number.  RichText box does text wraps for you even though there are no carriagereturn line feeds.  However you can replace strings.

1. Instr the string to search on the text of Richtextbox.
2. Select the text with selstart, sellength
3. Insert the new text



0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now