Private Sub CopyFileBlockSample()
Const strFn = "CopyFileBlockSample"
Dim strInFile As String
strInFile = CombinePathAndFile(GetWindowsDirectory, "WIN.INI")
strInFile = InputBox("Input file: ({Esc} cancels.)", strFn, strInFile)
If Len(strInFile) = 0 Then Exit Sub
Dim strOutFile As String
strOutFile = GetTempFileName(Null, strFn)
strOutFile = InputBox("Output file: (FILE WILL BE OVERWRITTEN; {Esc} cancels.)", strFn, strOutFile)
If Len(strOutFile) = 0 Then Exit Sub
Dim strStartByte As String
strStartByte = InputBox("Start copying from byte: (Blank means start at beginning of file.)", strFn, "1024")
Dim strCopyBytes As String
strCopyBytes = InputBox("Copy number of bytes: (Blank means copy to end of file.)", strFn, "512")
MsgBox "Return = " & CopyFileBlock(strInFile, strOutFile, strStartByte, strCopyBytes) & " (True means success; False means failure.)", vbInformation, strFn
End SubCopyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.