save all active drawings as pdf's

hi everyone,

i wrote this simple macro to save the current active document as a pdf and then close the file.  right now this work great but i now i want to try and have it so that it continues to run the macro on all of the drawings that are open.  this would allow me to open let's say 10 drawings, run the macro, and have it automatically create pdf's for me without any interaction from me.

here is my current code:

Dim swApp As Object
Dim swModel As ModelDoc2
Dim lErrors As Long
Dim lWarnings As Long

Sub main()

Call SaveAsPdf

swApp.CloseDoc (swModel.GetPathName)

End Sub

Sub SaveAsPdf()

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
swModel.Extension.SaveAs GetFilename(swModel.GetPathName) & ".pdf", swSaveAsCurrentVersion, swSaveAsOptions_Silent, Nothing, lErrors, lWarnings

End Sub

Function GetFilename(strPath As String) As String
    Dim strTemp As String
    strTemp = Mid\\\$(strPath, InStrRev(strPath, "\\") + 1)
    GetFilename = Left\\\$(strTemp, InStrRev(strTemp, ".") - 1)
End Function

SolidworksApi macros