Results 1 to 7 of 7

Thread: cut/copy/paste does not work

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    Mexico
    Posts
    12

    Unhappy cut/copy/paste does not work

    Hi, im developing a small app (my first app). well, the thing is that i can't copy, cut or paste any text unless i do it using the menu that appears when right clicking the selected text. If i use the buttons on the menu (Edit -> cut, copy, paste), the buttons on the bar (the little icons) or the shortcuts i assigned (ctrl + c, etc.) then copy/cut/paste won't work.

    I genereted this app (MDI app by the way) using the VBA wizard. Here's the genereted code for each action:

    Cut:

    Private Sub mnuEditarCortar_Click()
    On Error Resume Next
    Clipboard.SetText ActiveForm.rtfText.SelRTF
    ActiveForm.rtfText.SelText = vbNullString
    End Sub


    Copy:

    Private Sub mnuEditarCopiar_Click()
    On Error Resume Next
    Clipboard.SetText ActiveForm.rtfText.SelRTF
    End Sub


    Paste:

    Private Sub mnuEditarPegar_Click()
    On Error Resume Next
    ActiveForm.rtfText.SelRTF = Clipboard.GetText
    End Sub


    Removing the command "On Error Resume Next" i get the following error when trying to copy a selected text:

    Run-time error '438':
    Object doesn't support this property or method

    So, can anyone help me please?

    Thanks

  2. #2
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397
    what are you doing this in???

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    Mexico
    Posts
    12
    what are you doing this in???
    Im devolping my app using Visual Basic 6.0

  4. #4
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397
    i did this in Access VBA
    ----------------------------------------------------

    Dim fso As Object

    Set fso = CreateObject("scripting.filesystemobject")


    'copy the file from, to
    fso.CopyFile "H:\USERS\GROUPS\CLAIMS\Reports_from_Data_Analyst\Blocker\Current\*.xls", "H:\USERS\GROUPS\CLAIMS\Reports_from_Data_Analyst\Blocker\"

    'delete the file from the old location
    fso.deletefile "H:\USERS\GROUPS\CLAIMS\Reports_from_Data_Analyst\Blocker\Current\*.xls"

  5. #5
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Originally posted by Gerardo
    Im devolping my app using Visual Basic 6.0
    Gerardo,

    You would be better off posting in the General VB forum.
    And, when you do - Which Sub (Cut, Copy, Paste) and Line do you get the error?

  6. #6
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397
    Bruce

    is there a better way to cut and paste?

  7. #7
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    This is not a solution but.. in any case you should clear the clipboard before filling in data:

    Code:
    Clipboard.Clear
    Clipboard.SetText blabla

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