1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| ---------------------------------------
Private Sub Commande0_Click()
Dim w_action As String
Dim w_comment1 As String
Dim w_comment2 As String
Dim w_comment3 As String
Dim i As Double
For Each Mac In CurrentProject.AllMacros
Application.SaveAsText acMacro, Mac.Name, "d:\local\detmacro.txt"
DoCmd.DeleteObject acTable, "detmacro"
' import fichier "evenements" créé sous BO
DoCmd.TransferText acImportDelim, "Detmacro Spécification d'importation", "detmacro", "d:\local\detmacro.txt", False, ""
Set tab_in = CurrentDb.OpenRecordset("detmacro")
Set tab_out = CurrentDb.OpenRecordset("docobjet")
w_comment1 = ""
w_comment2 = ""
w_comment3 = ""
Do While tab_in.EOF = False
If tab_in![champ1] = "begin" Then
w_comment1 = "aa"
w_comment2 = "aa"
w_comment3 = "aa"
End If
If tab_in![champ1] = "Action" Then
w_action = tab_in![champ2].Value
End If
If tab_in![champ1] = "Comment" Then
w_comment1 = tab_in![champ2].Value
End If
If tab_in![champ1] = "Argument" Then
If w_comment2 = "aa" Then
w_comment2 = tab_in![champ2].Value
Else
If w_comment3 = "aa" Then
w_comment3 = tab_in![champ2].Value
End If
End If
End If
If tab_in![champ1] = "end" Then
tab_out.AddNew
tab_out.Fields("TypeObjet").Value = "macro"
tab_out.Fields("NomObjet").Value = Mac.Name
tab_out.Fields("Action").Value = w_action
'-la syntaxe left(right... a pour but de supprimer les guillements
tab_out.Fields("Commentaire").Value = Left(Right(w_comment1, Len(w_comment1) - 1), Len(w_comment1) - 2)
tab_out.Fields("Commentaire2").Value = Left(Right(w_comment2, Len(w_comment2) - 1), Len(w_comment2) - 2)
tab_out.Fields("Commentaire3").Value = Left(Right(w_comment3, Len(w_comment3) - 1), Len(w_comment3) - 2)
tab_out.Update
End If
tab_in.MoveNext
Loop
tab_in.Close
Next Mac |
Partager