Need to create a macro which will open Solidworks assembly files with browse function/select folder option to open assembly files and save as or export as a .smg files + batch process

Hello,
Need to create a macro which will open Solidworks assembly files with browse function/select folder option to open assembly files and save as or export as a .smg files + batch process.
Can anyone please provide some guidelines. 

@DG 
Hello Sir,
I tried to edit the code http://www.lennyworks.com/solidworks/SWXMacros/DocExport.zip

found on http://www.lennyworks.com/solidworks/default.asp?ID=20, by Leonard Kikstra but couldn't get what I want. 
Also, I need browse option and location selection for the exported files.

@LK 
Hello Sir,
Do you have any guidelines on this? 

Thank you.