Bonjour,

J'ai un pb avec la création d'un fichier PDF avec PDFCreator apres avoir créer un fichier PRN.

D'abord, je crée 1 fichier WORD, puis ensuite je crée un fichier PRN
Tout fonctionne correctement
Ensuite je rappelle les mêmes fonctions, pour lui dire de me creer un fichier PDF puis ensuite de creer le PRN et la plantage lors de la creation du fichier PDF

Il m'ouvre une fenêtre pour me demander de rendre le nom de mon fichier prn a sauvegarder

Pouvez-vous m'aider stp?


Voici mon code pour la conversion en PDF
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
22
23
24
Set myPDFCreator = New PDFCreator.clsPDFCreator
   With myPDFCreator
              If .cStart("/NoProcessingAtStartup") = False Then
                   MsgBox "Can't initialize PDFCreator.", vbCritical + vbOKOnly, "PrtPDFCreator"

               End If
             End With
         End If
         
         'Initialiser les options de sauvegarde de PDFCreator
         With myPDFCreator
            .cOption("UseAutosave") = 1
            .cOption("UseAutosaveDirectory") = 1
            .cOption("AutosaveDirectory") = theFileRoot
            .cOption("AutosaveFilename") = NomLettreSansExt
            .cOption("AutosaveFormat") = 0 ' 0 = PDF
            .cDefaultPrinter = "PDFCreator"
            .cClearCache
         End With
  
       ' impression de la lettre au format PDF
       Lettre.PrintOut          --> Plantage et ouverture fenêtre pour renseigner le nom du prn       Sleep 100
       myPDFCreator.cPrinterStop = False
      ....
Puis pour la sauve du fichier en prn, je fais

Lettre.PrintOut Copies:=GASI_Imp.NbCopies, PrintToFile:=GASI_Imp.fImpressionFic, OutPutFileName:=NomFicPrn