Here's some code I used to delete some custom properties with. It has a procedure for displaying a file tree window that I used in an Excel macro. This one recurses subdirectories, you have to comment out four lines near the bottom if you wish to perform your functions on files found ONLY in the directory you pick.
'Batch_DelCustInfo2.swp 08/19/03 by oorah
'
'A batch macro that recurses subdirectories.
'Deletes a Configuration Specific Custom Property for Part files, if it exists,
'without deleting a General Custom Property with the same name.
'
'To run macro:
'1. Must have swConst attached (Program Files...\Samples\appComm\swConst.bas
'2. Open Solidworks but do not open any parts
'3. Select this macro and go
Option Explicit
'Used in the directory function
Dim Msg As String
Dim bInfo As BROWSEINFO
Dim path As String
Dim r As Long, x As Long, pos As Integer
Dim GetDirectory As String
'Used in the ShowFolderList function
Dim fs, f, f1, fc, s
Dim num As Integer
Dim swApp As Object
Dim Part As Object
Dim Er As Long
Dim Warn As Long
Dim nme As String
'Used in the main function
Dim folderSpec As String
Dim retVal As Boolean
'Used in the directory function
Public Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
'32-bit API declarations used in the directory function
Declare Function SHGetPathFromIDList Lib "shell32.dll" _
Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Declare Function SHBrowseForFolder Lib "shell32.dll" _
Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Sub main()
On Error Resume Next
'Indentify a folder
'Put a message in the next line of code if you wish.
Msg = "Select a folder. This routine also updates subfolders."
'Root folder = Desktop
bInfo.pidlRoot = 0&
'Title in the dialog
If IsMissing(Msg) Then
bInfo.lpszTitle = "Select a folder."
Else
bInfo.lpszTitle = Msg
End If
'Type of directory to return
bInfo.ulFlags = &H1
'Display the dialog
x = SHBrowseForFolder(bInfo)
'Parse the result
path = Space$(512)
r = SHGetPathFromIDList(ByVal x, ByVal path)
If r Then
pos = InStr(path, Chr$(0))
GetDirectory = Left(path, pos - 1)
folderSpec = GetDirectory
Call ShowFolderList(folderSpec) 'call routine
Else
GetDirectory = ""
MsgBox ("Nothing selected, exit macro."

Set swApp = Nothing
Exit Sub
End If
MsgBox "Finished" 'Comment this line out if you know when you are finished or you don’t care"
End Sub
Sub ShowFolderList(folderSpec As String)
Set swApp = CreateObject("sldWorks.application"

'Grab ahold of the SolidWorks application
'or create an instance of it
If swApp Is Nothing Then Exit Sub 'If we fail to get the swApp then exit
Part.Visible = True 'Make sure SolidWorks is not running in the background
swApp.UserControl = True ' Give control to the user which will leave SolidWorks up
Set fs = CreateObject("Scripting.FileSystemObject"

'Grab ahold of the file system object, kind of like getting windows explorer
Set f = fs.GetFolder(folderSpec) 'Attach to the folder object
Set fc = f.Files 'get a list of files
For Each f1 In fc 'Now we loop through every file in the folder
nme = f1.Name 'Get the file path
If StrComp(UCase(Right(nme, 6)), "SLDPRT"

= 0 Then 'if it ends with "SLDPRT" then do some more stuff
If StrComp(UCase(Left(nme, 2)), "~$"

<> 0 Then 'Don’t grab a temporary file
nme = f1.path 'Get the file path instead of the name
Set Part = swApp.OpenDoc6(nme, 1, swOpenDocOptions_Silent, "", Er, Warn) 'Open the SW file
If Part Is Nothing Then
MsgBox "Failed to Open " & nme 'uncomment this line to see an error message if the macro fails to open a part
GoTo A0001
End If
Set Part = swApp.ActivateDoc(nme) 'make sure it is the active file
'Below this we enter code to do something with the file we opened
retVal = Part.DeleteCustomInfo2("Default", "Revision"

retVal = Part.DeleteCustomInfo2("Default", "PartNo"

retVal = Part.DeleteCustomInfo2("Default", "Description"

retVal = Part.DeleteCustomInfo2("Default", "DrawnBy"

retVal = Part.DeleteCustomInfo2("Default", "Date"

retVal = Part.DeleteCustomInfo2("Default", "CurrentRev"

retVal = Part.DeleteCustomInfo2("Default", "Material"

retVal = Part.DeleteCustomInfo2("Default", "Finish"

retVal = Part.DeleteCustomInfo2("Default", "Note"

retVal = Part.DeleteCustomInfo2("Default", "StockType"

retVal = Part.DeleteCustomInfo2("Default", "StockWdth"

retVal = Part.DeleteCustomInfo2("Default", "StockHgth"

retVal = Part.DeleteCustomInfo2("Default", "StockLgth"

retVal = Part.DeleteCustomInfo2("Default", "StockID"

retVal = Part.DeleteCustomInfo2("Default", "StockOD"

retVal = Part.DeleteCustomInfo2("Default", "Density"

retVal = Part.DeleteCustomInfo2("Default", "StockWeight"

retVal = Part.DeleteCustomInfo2("Default", "Weight"

retVal = Part.DeleteCustomInfo2("Default", "Cost"

retVal = Part.DeleteCustomInfo2("Default", "Project"

retVal = Part.DeleteCustomInfo2("Default", "CompanyName"

retVal = Part.DeleteCustomInfo2("Default", "Department"

retVal = Part.DeleteCustomInfo2("Default", "Rev1"

retVal = Part.DeleteCustomInfo2("Default", "Rev1Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev1By"

retVal = Part.DeleteCustomInfo2("Default", "Rev1Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev2"

retVal = Part.DeleteCustomInfo2("Default", "Rev2Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev2By"

retVal = Part.DeleteCustomInfo2("Default", "Rev2Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev3"

retVal = Part.DeleteCustomInfo2("Default", "Rev3Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev3By"

retVal = Part.DeleteCustomInfo2("Default", "Rev3Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev4"

retVal = Part.DeleteCustomInfo2("Default", "Rev4Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev4By"

retVal = Part.DeleteCustomInfo2("Default", "Rev4Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev5"

retVal = Part.DeleteCustomInfo2("Default", "Rev5Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev5By"

retVal = Part.DeleteCustomInfo2("Default", "Rev5Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev6"

retVal = Part.DeleteCustomInfo2("Default", "Rev6Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev6By"

retVal = Part.DeleteCustomInfo2("Default", "Rev6Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev7"

retVal = Part.DeleteCustomInfo2("Default", "Rev7Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev7By"

retVal = Part.DeleteCustomInfo2("Default", "Rev7Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev8"

retVal = Part.DeleteCustomInfo2("Default", "Rev8Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev8By"

retVal = Part.DeleteCustomInfo2("Default", "Rev8Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev9"

retVal = Part.DeleteCustomInfo2("Default", "Rev9Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev9By"

retVal = Part.DeleteCustomInfo2("Default", "Rev9Note"

retVal = Part.DeleteCustomInfo2("Default", "Rev10"

retVal = Part.DeleteCustomInfo2("Default", "Rev10Date"

retVal = Part.DeleteCustomInfo2("Default", "Rev10By"

retVal = Part.DeleteCustomInfo2("Default", "Rev10Note"
'Above this we have entered code to do something with our SW files
'now close the part
Part.Save2 (True) 'uncomment this line to save changes to your sw file
Set Part = Nothing 'Release the Part object
swApp.QuitDoc nme 'close the part doc, do not save changes
A0001:
nme = "" 'Reset the nme variable to nothing so it does not loop accidentally"
End If
End If
Next 'comment the following four lines to avoid recursing subdirectories
Set fc = f.SubFolders 'Now get the sub folders
For Each f1 In fc 'loop through the folders
Call ShowFolderList(f1.path) 'Call this routine for every folder
Next
End Sub