This is something I just worked out in my little homemade browser. An easy way to do it is to use the MDI form's ActiveForm property:
Code:
'in the MDI form
Private Sub mnuSave_Click()
   'a quick save example to save the text of CODE on on the currently active child window
   Open "c:\dummyfile.txt" For Output As #1
   Print #1, MDIForm.ActiveForm.CODE.Text
   Close #1
End Sub