Detaching reference files in vba


I have an app which attaches an arbitrary number of reference files, then copies all elements on a level to the master dgn. When this process is complete I want to detach all the reference files. Is there a method which does that all is one shot or do I need to detach them one by one?