Double Space in RTB

Posted on 2004-09-20
Last Modified: 2010-05-02
Does anyone know how to doublespace lines in a RTB  lso i just want to double space the lines i have selected.






Question by:BI5HOP
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
LVL 26

Accepted Solution

EDDYKT earned 250 total points
ID: 12104478
How about

Private Sub rtfText_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = 13) Then
    If (Len(rtfText.SelText) > 0) Then
        Debug.Print Replace(Replace(rtfText.SelText, vbCrLf & vbCrLf, vbCrLf), vbCrLf, vbCrLf & vbCrLf)
        KeyCode = 0
        rtfText.SelText = Replace(Replace(rtfText.SelText, vbCrLf & vbCrLf, vbCrLf), vbCrLf, vbCrLf & vbCrLf)
    End If
End If
End Sub

Author Comment

ID: 12105513
I had to make a small change since i wanted it on rightclick i forgot to mention that but yea it worked great thanks :)


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

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