Export Method Example

The following example creates a file named test.bas and uses the Export method to copy the contents of the VBComponents(1) code module into the file.

Application.VBE.ActiveVBProject.VBComponents(1).Export("test.bas")