How could I use a component of Microsoft Office in my VB Code?

I'm building an Editor for TMS370 CPU and i'll like to use the capabilities of Microsoft Word if possible, otherwise i'll keep using Ritch Box Control so then i'll need to know how to implement a number to each line of text wrote in this control.

Thanx in advance

Comments

  • [b][red]This message was edited by kel1981b at 2003-5-1 8:48:6[/red][/b][hr]
    : I'm building an Editor for TMS370 CPU and i'll like to use the capabilities of Microsoft Word if possible, otherwise i'll keep using Ritch Box Control so then i'll need to know how to implement a number to each line of text wrote in this control.
    :
    : Thanx in advance
    :
    There is some example of code for RichText box. I am not sure that's exactly what you need but you can play with that
    [code]Option Explicit
    Dim intLineNbr As Integer

    Private Sub Form_Load()
    intLineNbr = 1
    End Sub

    Private Sub RichTextBox1_KeyUp(KeyCode As Integer, Shift As Integer)
    ' RichTextBox1.SelBullet = True
    If KeyCode = vbKeyReturn Then
    RichTextBox1.SelText = CStr(intLineNbr) & ". "
    intLineNbr = intLineNbr + 1
    End If
    End Sub[/code]



  • Kel1981b , thanx for your example, it's fine with me but i need this number won't be modifiable, so it just give me a reference where line i'm in.

    one more question, can i fix maximum text lines in a Ritch control? I know it has maximum amount of characters, but i don't see the way of prevent for a maximum lines number.

    Thanx in advance

    : [b][red]This message was edited by kel1981b at 2003-5-1 8:48:6[/red][/b][hr]
    : : I'm building an Editor for TMS370 CPU and i'll like to use the capabilities of Microsoft Word if possible, otherwise i'll keep using Ritch Box Control so then i'll need to know how to implement a number to each line of text wrote in this control.
    : :
    : : Thanx in advance
    : :
    : There is some example of code for RichText box. I am not sure that's exactly what you need but you can play with that
    : [code]Option Explicit
    : Dim intLineNbr As Integer
    :
    : Private Sub Form_Load()
    : intLineNbr = 1
    : End Sub
    :
    : Private Sub RichTextBox1_KeyUp(KeyCode As Integer, Shift As Integer)
    : ' RichTextBox1.SelBullet = True
    : If KeyCode = vbKeyReturn Then
    : RichTextBox1.SelText = CStr(intLineNbr) & ". "
    : intLineNbr = intLineNbr + 1
    : End If
    : End Sub[/code]
    :
    :
    :
    :

  • : one more question, can i fix maximum text lines in a Ritch control? I know it has maximum amount of characters, but i don't see the way of prevent for a maximum lines number.
    :
    Is it limited? I've never knew that. Sorry, but I have no idea how to do that.
  • : : one more question, can i fix maximum text lines in a Ritch control? I know it has maximum amount of characters, but i don't see the way of prevent for a maximum lines number.
    : :
    : Is it limited? I've never knew that. Sorry, but I have no idea how to do that.
    :
    Thanx anyway, i'll keep looking
  • : : : one more question, can i fix maximum text lines in a Ritch control? I know it has maximum amount of characters, but i don't see the way of prevent for a maximum lines number.
    : : :
    : : Is it limited? I've never knew that. Sorry, but I have no idea how to do that.
    : :
    : Thanx anyway, i'll keep looking
    :
    Sorry, I think I missunderstood your question. You asked how to limit number of lines, did not you? I still do not know any RichText properties you can use to do that. But you can try something like that
    [code]Private Sub RichTextBox1_KeyUp(KeyCode As Integer, Shift As Integer)
    Dim intNbtLimitedLines as Ingeger
    intNbtLimitedLines = 6 'limited number of lines to 6
    ' RichTextBox1.SelBullet = True
    If KeyCode = vbKeyReturn Then
    If intLineNbr >= intNbtLimitedLines Then
    RichTextBox1.MaxLength = Len(RichTextBox1.Text)
    Exit Sub
    Else
    RichTextBox1.SelText = CStr(intLineNbr) & ". "
    intLineNbr = intLineNbr + 1
    End If
    End If
    End Sub[/code]
    trying to limited it


  • : : : : one more question, can i fix maximum text lines in a Ritch control? I know it has maximum amount of characters, but i don't see the way of prevent for a maximum lines number.
    : : : :
    : : : Is it limited? I've never knew that. Sorry, but I have no idea how to do that.
    : : :
    : : Thanx anyway, i'll keep looking
    : :
    : Sorry, I think I missunderstood your question. You asked how to limit number of lines, did not you? I still do not know any RichText properties you can use to do that. But you can try something like that
    : [code]Private Sub RichTextBox1_KeyUp(KeyCode As Integer, Shift As Integer)
    : Dim intNbtLimitedLines as Ingeger
    : intNbtLimitedLines = 6 'limited number of lines to 6
    : ' RichTextBox1.SelBullet = True
    : If KeyCode = vbKeyReturn Then
    : If intLineNbr >= intNbtLimitedLines Then
    : RichTextBox1.MaxLength = Len(RichTextBox1.Text)
    : Exit Sub
    : Else
    : RichTextBox1.SelText = CStr(intLineNbr) & ". "
    : intLineNbr = intLineNbr + 1
    : End If
    : End If
    : End Sub[/code]
    : trying to limited it
    :
    :
    :
    Thanx once again Kel1981b, but what if i also want to count new lines comming from wrap text when lines are larger than Ritch control Width property?
  • : :
    : Thanx once again Kel1981b, but what if i also want to count new lines comming from wrap text when lines are larger than Ritch control Width property?
    :
    Did you try it? I did. Now it's your turn. Look, I am not big expert in RichTextBox control because I use it quit rearly. I am also working guy. So, I am playing with this control trying to help you when I have time because it's fun for me and like to help people. Unfortunately, I do not have that much spare time to conduct experiments for your project. I have my own one. Please, do it yourself. If you will have some problem let me know and I'll try to help.
  • : : :
    : : Thanx once again Kel1981b, but what if i also want to count new lines comming from wrap text when lines are larger than Ritch control Width property?
    : :
    : Did you try it? I did. Now it's your turn. Look, I am not big expert in RichTextBox control because I use it quit rearly. I am also working guy. So, I am playing with this control trying to help you when I have time because it's fun for me and like to help people. Unfortunately, I do not have that much spare time to conduct experiments for your project. I have my own one. Please, do it yourself. If you will have some problem let me know and I'll try to help.
    :

    Thanx you man, i thought in a solution, but i need to know how to access to this control ScrollBar properties, do you know how to access to Ritch Control's scroll properties?


  • : Thanx you man, i thought in a solution, but i need to know how to access to this control ScrollBar properties, do you know how to access to Ritch Control's scroll properties?
    :
    :
    Unfortunately, answer is No.
  • :
    : : Thanx you man, i thought in a solution, but i need to know how to access to this control ScrollBar properties, do you know how to access to Ritch Control's scroll properties?
    : :
    : :
    : Unfortunately, answer is No.
    :

    Thanx anyway for your time and help
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion