Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My INSERT code Will Not Work PLEASE HELP!!!!

Status
Not open for further replies.

da7

Technical User
Sep 10, 2001
3
GB
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 = &quot;<B></B>&quot;
txtinformation.SetFocus
SendKeys &quot;{END}&quot;

Else
txtinformation = txtinformation & &quot;<B></B>&quot;
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 ????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top