Bonjour,
le plus difficile c'est que ça marche parfaitement chez moi!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Sub test() Dim Path As String, rs As Object Path = Replace(CurrentDb.Name, Split(CurrentDb.Name, "\")(UBound(Split(CurrentDb.Name, "\"))), "") Set rs = CurrentDb.OpenRecordset("Select [Standards].[Pseudo],[Standards].[Standard_HTM] from [Standards]") While Not rs.EOF CreerFichierTxt Path & "fichiers_html\" & rs("Pseudo").Value & ".HTML", rs("Standard_HTM").Value rs.MoveNext Wend rs.Close End Sub Private Sub CreerFichierTxt(Fichier As String, txt As String) Dim fso, NewFichier Set fso = CreateObject("Scripting.FileSystemObject") Set NewFichier = fso.OpenTextFile(Fichier, 2, True) NewFichier.Write txt NewFichier.Close Set NewFichier = Nothing Set fso = Nothing End Sub
Partager