I'm trying to write a macro which will delete specific files from a folder based on the value of custom property but could not get as what should be the codes for deleting the file.. Here are my codes
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim sFileName As String
Dim Path As String
Dim nErrors As Long
Dim nWarnings As Long
Set swApp = Application.SldWorks
Path = "C:\SolidWorks\Test\"
sFileName = Dir(Path & "*.SLDPRT")
Do Until sFileName = ""
Set swModel = swApp.OpenDoc6(Path + sFileName, swDocPART, swOpenDocOptions_Silent, "", nErrors, nWarnings)
Set swModel = swApp.ActiveDoc
If swModel.CustomInfo2("", "Description") = "XYZ" Then
'What codes needs to be inserted here to delete the file.
Set swModel = Nothing
sFileName = Dir