timetrack-pro/delete_by_name.vbs
StillHammer 7c3dd3fb31 Add VBS scripts, documentation, and HTML form templates
- Test and helper VBS scripts for VBA MCP development
- Technical reference documentation and PDFs
- HTML form templates for all 5 forms
- PowerShell and Python scripts for PDF/documentation generation

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-21 11:53:09 +07:00

50 lines
1.2 KiB
Plaintext

On Error Resume Next
Dim accessApp
Set accessApp = CreateObject("Access.Application")
accessApp.OpenCurrentDatabase "C:\Users\alexi\Documents\projects\timetrack-pro\db\TimeTrackPro.accdb"
WScript.Echo "=== Deleting specific fake modules ==="
Dim vbProj
Set vbProj = accessApp.VBE.VBProjects(1)
' Supprimer un par un par nom
Dim modulesToDelete
modulesToDelete = Array("Form_frm_Accueil", "Form_frm_Clients", "Form_frm_Projets", "Form_frm_Historique")
Dim i
For i = LBound(modulesToDelete) To UBound(modulesToDelete)
Dim comp
Set comp = Nothing
' Trouver le module
Dim c
For Each c In vbProj.VBComponents
If c.Name = modulesToDelete(i) Then
Set comp = c
Exit For
End If
Next
' Supprimer si trouve
If Not comp Is Nothing Then
WScript.Echo "Deleting: " & comp.Name & " (Type " & comp.Type & ")"
vbProj.VBComponents.Remove comp
WScript.Echo " -> Deleted!"
Else
WScript.Echo "Not found: " & modulesToDelete(i)
End If
Next
WScript.Echo ""
WScript.Echo "=== Remaining modules ==="
For Each c In vbProj.VBComponents
WScript.Echo c.Name & " - Type: " & c.Type
Next
accessApp.CloseCurrentDatabase
accessApp.Quit
Set accessApp = Nothing