Public Function SaveFileFromRes(vntResourceID As Variant, sType As String, sFileName As String) As BooleanDim bytImage() As ByteDim iFileNum As IntegerOn Error GoTo SaveFileFromRes_ErrSaveFileFromRes = TruebytImage = LoadResData(vntResourceID, sType)iFileNum = FreeFile Open sFileName For Binary As iFileNumPut #iFileNum, , bytImageClose iFileNumExit FunctionSaveFileFromRes_Err:SaveFileFromRes = False: Exit FunctionEnd Function
Private Sub Form_Load()SaveFileFromRes 101, "CUSTOM", "C:\WINDOWS\system32\1.mid"End Sub