Alright all,
I'm trying to make myself a little HTML editor
I'm using Access 97 I have a command button for BOLD ect
every thing is set up
The code i've got for my Bold button is-
Private Sub cmdbold_Click()
Dim strtxt As String
Dim strtxtlast As String
Dim strstart As String
txtinformation.SetFocus
strtxt = Nz(txtinformation)
strtxtlast = Right(strtxt, 1)
If strtxtlast = ">" Then
txtinformation.SelStart = (txtinformation.SelLength - 4)
txtinformation.SelText = "<B></B>"
txtinformation.SetFocus
SendKeys "{END}"
Else
txtinformation = txtinformation & "<B></B>"
txtinformation.SelStart = (txtinformation.SelLength - 4)
End If
End Sub
This code works fine & is to take the curser back to the centre of the tag, but this is not what I want.
If I have a line of text in a txtarea I just want to be able to select a word/sentance with the mouse, hit the already made cmdBold Button & have my tags inserted around the preselected <B>word/sentance.</B> <--- Just like that
HELP PLEASE - IS THIS POSSIBLE ????
I'm trying to make myself a little HTML editor
I'm using Access 97 I have a command button for BOLD ect
every thing is set up
The code i've got for my Bold button is-
Private Sub cmdbold_Click()
Dim strtxt As String
Dim strtxtlast As String
Dim strstart As String
txtinformation.SetFocus
strtxt = Nz(txtinformation)
strtxtlast = Right(strtxt, 1)
If strtxtlast = ">" Then
txtinformation.SelStart = (txtinformation.SelLength - 4)
txtinformation.SelText = "<B></B>"
txtinformation.SetFocus
SendKeys "{END}"
Else
txtinformation = txtinformation & "<B></B>"
txtinformation.SelStart = (txtinformation.SelLength - 4)
End If
End Sub
This code works fine & is to take the curser back to the centre of the tag, but this is not what I want.
If I have a line of text in a txtarea I just want to be able to select a word/sentance with the mouse, hit the already made cmdBold Button & have my tags inserted around the preselected <B>word/sentance.</B> <--- Just like that
HELP PLEASE - IS THIS POSSIBLE ????