Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1190 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  access transformer un etat en pdf via vb

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

access transformer un etat en pdf via vb

n°469789
codi
Posté le 28-07-2003 à 14:26:46  profilanswer
 

Voila je cherche a creer un pdf a partir d'un etat pour pouvoir l'envoyer par e-mail, sans perte de mise en page.
 
j'ai acrobat writer d'installer sur la machine.

mood
Publicité
Posté le 28-07-2003 à 14:26:46  profilanswer
 

n°478841
Cyberpat92
Posté le 06-08-2003 à 10:37:24  profilanswer
 


Appelle SetPrinter avec le nom de ton imprimante, puis SetPDFFile. Si c'est ok, tu peux lancer ton impression depuis Access, et le PDF sera créé avec le nom que tu as choisi.
 
 
'------------------------
 
Private Declare Function ExtEscape Lib "gdi32" ( _
                                                    ByVal hdc As Long, _
                                                    ByVal nEscape As Long, _
                                                    ByVal cbInput As Long, _
                                                    lpszInData As Any, _
                                                    ByVal cbOutput As Long, _
                                                    ByVal lpszOutData As String _
                                                ) As Long
 
Private Const PDFFILENAME = 4312
Private Const PDFINPUT_OK = 1
Private Const PDFINPUT_FAIL = -1
 
Private Function SetPrinter(ByVal PrinterName As String) As Boolean
    Dim i As Long
 
    SetPrinter = False
    For i = 0 To Printers.Count - 1
        If Printers(i).DeviceName = PrinterName Then
            Set Printer = Printers(i)
            SetPrinter = True
            Exit For
        End If
    Next i
End Function
 
Private Function SetPDFFile(FileName As String) As Boolean
    'A note on specifying the metadata in a PDF file.***
    'Although it is possible to set the creation date, modification
    'date, creator and producer using the above structure, we do not
    'suggest that you do so. If you leave these blank PDF Writer will
    'fill in appropriate values. If you set the date yourself and it
    'does not meet the PDF specification it may cause trouble for readers
    'of the PDF. PDFWriter will set the appropriate date using the system
    'clock, use the application name from the DOCINFO struct and set itself
    'as the producer
     
    Dim PDFWriterProperties As PDFInput
     
    PDFWriterProperties.outputfilename = FileName + Chr$(0)
    PDFWriterProperties.docinfo.title = Chr$(0)
    PDFWriterProperties.docinfo.author = Chr$(0)
    PDFWriterProperties.docinfo.creationDate = Chr$(0)
    PDFWriterProperties.docinfo.creator = Chr$(0)
    PDFWriterProperties.docinfo.producer = Chr$(0)
    PDFWriterProperties.docinfo.subject = Chr$(0)
    PDFWriterProperties.docinfo.keywords = Chr$(0)
    PDFWriterProperties.docinfo.modDate = Chr$(0)
     
    If ExtEscape(Printer.hdc, PDFFILENAME, Len(PDFWriterProperties), PDFWriterProperties, 0, 0) = PDFINPUT_OK Then
        ' Printer Escape Settings successful, now start the print job
        SetPDFFile = True
    Else
        'Printer Escape Settings failed
        SetPDFFile = False
    End If
End Function

n°478920
codi
Posté le 06-08-2003 à 11:46:29  profilanswer
 

merci  :jap:


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  access transformer un etat en pdf via vb

 

Sujets relatifs
[Access] Comment évolue l'espace disque selon les enregistrements !Transformer/Intégrer un XLS dans une base SQL/mySQL
[VBA Access] Le nom des variables reste til "visible" dans les ".mde"transformer une page html pour l'integréer sur le forum
Access requête sur reception du focusBouton parcourir en VBA (pour Access)
[PHP] Transformer une chaine contenant de l'hexa en hexa...Access, tu me soules !!
Temps de transfert Base Access ...SQL serveur[VBA, access] mettre autre chose qu'un fichier office en 'object'
Plus de sujets relatifs à : access transformer un etat en pdf via vb


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR