Results 1 to 2 of 2

Thread: How do I add this into my textbox?

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245
    I need to make it so that at anytime you are typing into my text editor and you want to add a table you would just click on the mnu option and it will add the following in the exact format onto the page right where the cursor curently is. How can I code it print the following and keep the exact right where the cursor is, onto the page?

    <CENTER><TABLE ALIGN=CENTER VALIGN=TOP BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="" HEIGHT="" BACKGROUND="">
    <TR>
    <TD>

    </TD></TR>
    </TABLE></CENTER>

    I would greatly appreciate any suggestions,
    Daniel Christie

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Posts
    125
    Text1.SelStart is the location of the cursor

    so you use

    Code:
    Dim S$, where&
    S = Text1
    where = Text1.SelStart
    
    Text1 = Left$(S, where) & _
            "your text goes here" & _
            Right$(S, Len(S) - where)
    put in
    & vbCrLf &
    where you want your text to start on a new line

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width