Thanks for your answers. I have tried using this function under Visual Basic 6.0 with Service Pack 5. The function creates a file as expected, except that the file contains the wrong data. Can one use this function for any data type, or only for "arbitrary block data"?