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!

I trying to make a basic HTML editor but my tags will not insert

Status
Not open for further replies.

da7

Technical User
Sep 10, 2001
3
GB
I've got my Form sorted all i want to do, is to be able to highlight txt in a txtbox hit my bold button and have the tag<B> inserted at the start of the selected txt and </B> @ the end.
Is this possible? if so, Please could someone show me the code how to do it.

thanx!
 
You can't use the built in Bold button. What you can do, is have a command button, and have the following (assuming your text box is named txtMyText)

Command_1 On Click()
me.txtMyText = &quot;&quot; & txtMyText & &quot;&quot;
Tyrone Lumley
augerinn@gte.net
 
Hi Databaseguy
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 = &quot;>&quot; 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 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 word/sentance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top