Copy, Cut and Paste files

Posted on 1999-01-09
Last Modified: 2010-05-03
Is there any possibility to cut, paste and copy files when using FileListBox. If there is, how? What are the codes?
Question by:Ecmil
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 12

Accepted Solution

mark2150 earned 100 total points
ID: 1455062
Cut, paste, copy *files*?????

Ummm, no (assuming I understand what you're asking). You do the normal file copy stuff like you would on any binary file (open one for input, another for output and copy from in to out until EOF)



Author Comment

ID: 1455063
Adjusted points to 100

Author Comment

ID: 1455064
I want to cut, paste and copy files like in the explorer

Author Comment

ID: 1455065
How do I do the normal file copy stuff like with any binary file
    (open one for input, another for output and copy from in to out until EOF) ?????
LVL 12

Expert Comment

ID: 1455066
' FileSpec$ = Full name/path of original file
' filnam$ = Root file name in local directory
' Ok, we want to copy in large blocks for speed, but we
' can't get too big or we'll run out of buffer
If Len(filnam$) > 0 Then
    rawsize = FileLen(filespec$)
    numblocks = Int(rawsize / 4096)
    fraction = rawsize Mod 4096
    Open filespec$ For Binary As #1
    Open maildir$ + filnam$ For Binary As #2
    If numblocks < 1 Then GoTo copytail
    For cindex = 1 To numblocks
        bite$ = Space$(4096)
        Get #1, , bite$
        Put #2, , bite$
    Next cindex
    If fraction > 0 Then
        bite$ = Space$(fraction)
        Get #1, , bite$
        Put #2, , bite$
    End If
End If


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question