bonjour,
je souhaite créer un dossier dans répertoire puis enregistrer des fichiers dans ce nouveau dossier.
j'arrive à créer mon dossier mais pas à enregistrer mes fichiers dans ce dernier.
merci de votre aide.
voici le code:
Private Sub CommandButton1_Click()
On Error GoTo err
Dim oFSO As Scripting.FileSystemObject
Dim oDrv As Drive
Dim oFld As Folder
'Instanciation du FSO
Set oFSO = New Scripting.FileSystemObject
'Crée le repertoire
Set oFld = oFSO.CreateFolder("C:\PROCESSUS\" & TextBox1.Value)
Dim mGraphicObject As Esprit.GraphicObject
Dim App As Esprit.Application
Dim doc As Esprit.Document
'Set App = Application
'Set doc = App.Document
On Error Resume Next
Dim OP As Esprit.Operation
Dim OPTech As EspritTechnology.Technology
Dim i As Long
For i = 1 To Document.Operations.Count
Set OP = Document.Operations.Item(i)
Set OPTech = OP.Technology
OPTech.Save ("C:\PROCESSUS\" & TextBox1.Value \ i & "-" & OP.Name & ".prc")
Call Application.OutputWindow.Text("Operation :" & OP.Name & vbCrLf)
Next
MsgBox ("Processus Enregistrés dans C:\PROCESSUS")
End 'fin de la macro
'Call Enregistrement
fin:
Exit Sub
err:
Select Case err.Number
Case 58: MsgBox "Le dossier existe déjà"
Case 76: MsgBox "Chemin incorrect"
Case Else: MsgBox "Erreur inconnue"
End Select
Resume fin
End Sub
Partager