Results 1 to 3 of 3

Thread: [RESOLVED] Copy, Paste, Delete, Cut, Selct All

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Posts
    272

    Resolved [RESOLVED] Copy, Paste, Delete, Cut, Selct All

    does anyone know what the code is for basic editing commands?

    for example, let's say i have a string of text loaded in a variable called str, and i want to copy tht text and have it pasted to the clipboard so i can paste it where i want to somewhere else.

    i tried copy.str, and str.copy, but of course that did not work.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Copy, Paste, Delete, Cut, Selct All

    Code:
    'Cut
    Clipboard.Clear
    Clipboard.SetText Screen.ActiveControl.SelText
    Screen.ActiveControl.SelText = vbNullString
    
    'Copy
    Clipboard.Clear
    Clipboard.SetText Screen.ActiveControl.SelText, vbCFText
    
    'Paste
    Screen.ActiveControl.SelText = Clipboard.GetText()
    
    'Delete
    Screen.ActiveControl.SelText = vbNullString

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Posts
    272

    Re: Copy, Paste, Delete, Cut, Selct All

    thanks. works great.

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