IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBA PowerPoint Discussion :

imprimer en Pdf protégé [PPT-2010]


Sujet :

VBA PowerPoint

  1. #1
    Membre éprouvé Avatar de graphikris
    Homme Profil pro
    Pas tres doué
    Inscrit en
    Décembre 2012
    Messages
    1 222
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Pas tres doué
    Secteur : Conseil

    Informations forums :
    Inscription : Décembre 2012
    Messages : 1 222
    Par défaut imprimer en Pdf protégé
    Bonjour,
    Je voudrais créer un bouton sur une diapo (sommaire) qui permettrait à celui qui utilise le PPS (diapo autonome) de pouvoir imprimer(*) le diaporama en mode paysage, recto verso sur le coté le plus petit, agrafé en haut à gauche, le tout au format PDF en mode protégé en modification (chiffré par mot de passe).
    (*) l'imprimante que j'utilise peut agrafer

    Cordialement,
    Graphikris.

  2. #2
    Expert confirmé
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 130
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 130
    Par défaut
    Salut, si cela peut t'aider,voir PDFCreator Envoi par Mail d'un fichier PDF protégé et PDFCreator Conversion dossier Jpg/Jpeg en PDFs protégés par mots de passe propriétaire/utilisateur
    Il y a ceci : Comment faire : Définir Duplex d’impression pour l’automatisation de Word mais pour Word resterait donc à adapter pour PPT ( pas testé ici car PPT jamais installé ni utilisé )

  3. #3
    Membre éprouvé Avatar de graphikris
    Homme Profil pro
    Pas tres doué
    Inscrit en
    Décembre 2012
    Messages
    1 222
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Pas tres doué
    Secteur : Conseil

    Informations forums :
    Inscription : Décembre 2012
    Messages : 1 222
    Par défaut
    Merci Kiki29 mais cela ne m'aide pas trop car dans PPT, les macros c'est pas comme dans XLS et je ne vois pas comment pouvoir adapter.
    @+

  4. #4
    Expert confirmé
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 130
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 130
    Par défaut
    Salut, un exemple parcellaire qui ici fonctionne pour la génération d'un pdf protégé, la prise en compte des paramètres d'impression restera à ta charge, les chemins seront à adapter: AutosaveDirectory , etc.

    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
    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
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    Option Explicit
     
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
     
    Dim sChemin As String
     
    Private Sub Chemin()
    Dim JobPDF As Object
     
        Set JobPDF = CreateObject("PDFCreator.clsPDFCreator")
     
        With JobPDF
            If .cStart("/NoProcessingAtStartup") = False Then
                MsgBox "Initialisation PDFCreator impossible.", vbCritical + _
                                                                vbOKOnly, "PDFCreator"
                Exit Sub
            End If
            sChemin = .coption("AutosaveDirectory")
        End With
     
        Set JobPDF = Nothing
        Kill_PDFCreator
    End Sub
     
    Private Sub EncryptPDFUsingPdfforgeDll(sNomFichier As String, sOutputCrypt As String)
    Dim Pdf As Object, Crypt As Object
     
        Set Crypt = CreateObject("pdfforge.pdf.PDFEncryptor")
     
        With Crypt
            .AllowAssembly = False
            .AllowCopy = False
            .AllowFillIn = False
            .AllowModifyAnnotations = False
            .AllowModifyContents = False
            .AllowPrinting = True
            .AllowPrintingHighResolution = True
            .AllowScreenReaders = False
            .EncryptionMethod = 2
     
            .OwnerPassword = "master"
            .UserPassword = ""
        End With
     
        Set Pdf = CreateObject("pdfforge.pdf.pdf")
        Pdf.EncryptPDFFile sNomFichier, sOutputCrypt, Crypt
        Set Pdf = Nothing
     
        Set Crypt = Nothing
    End Sub
     
    Sub GénérerPDF()
    Dim sNomPdf As String, sPdf As String
    Dim sDossier As String
    Dim sNomCrypt As String
    Dim FSO As Object
     
        sDossier = ActivePresentation.Path
        Chemin
     
        Set FSO = CreateObject("Scripting.FileSystemObject")
        sNomPdf = FSO.GetBaseName(ActivePresentation.Name) & ".pdf"
        Set FSO = Nothing
        sPdf = sChemin & sNomPdf
     
        With ActivePresentation.PrintOptions
            .RangeType = ppPrintAll
            .NumberOfCopies = 1
            .Collate = msoTrue
            .OutputType = ppPrintOutputSlides
            .PrintHiddenSlides = msoTrue
            .PrintColorType = ppPrintColor
            .FitToPage = msoTrue
            .FrameSlides = msoFalse
            .ActivePrinter = "Adobe PDF"
        End With
     
        ActivePresentation.PrintOut
     
        Sleep 2000
     
        sNomCrypt = sDossier & "\" & "Tempo.pdf"
        EncryptPDFUsingPdfforgeDll sPdf, sNomCrypt
        Set FSO = CreateObject("Scripting.FileSystemObject")
        If FSO.FileExists(sPdf) Then Kill sPdf
        If FSO.FileExists(sNomPdf) Then Kill sNomPdf
        Name sNomCrypt As sNomPdf
        Set FSO = Nothing
     
    End Sub
     
    Private Sub Kill_PDFCreator()
    Dim RetVal As Long
        RetVal = Shell("Taskkill /im PDFCreator.exe /f", 0)
    End Sub
    Images attachées Images attachées  

  5. #5
    Membre éprouvé Avatar de graphikris
    Homme Profil pro
    Pas tres doué
    Inscrit en
    Décembre 2012
    Messages
    1 222
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Pas tres doué
    Secteur : Conseil

    Informations forums :
    Inscription : Décembre 2012
    Messages : 1 222
    Par défaut
    Bonjour et merci a toi,
    j'essaye dès lundi.
    Bon W.E

  6. #6
    Expert confirmé
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 130
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 130
    Par défaut
    Re, n'ayant pas installé la version 2007 de PPT au moment de l'essai ... bref cela se résumera à qqch comme :

    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
    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
    Option Explicit
     
    Private Sub EncryptPDF(sNomFichier As String, sOutputCrypt As String)
    Dim Pdf As Object, Crypt As Object
     
        Set Crypt = CreateObject("pdfforge.pdf.PDFEncryptor")
     
        With Crypt
            .AllowAssembly = False
            .AllowCopy = False
            .AllowFillIn = False
            .AllowModifyAnnotations = False
            .AllowModifyContents = False
            .AllowPrinting = True
            .AllowPrintingHighResolution = True
            .AllowScreenReaders = False
            .EncryptionMethod = 2
     
            .OwnerPassword = "master"
            .UserPassword = ""
        End With
     
        Set Pdf = CreateObject("pdfforge.pdf.pdf")
        Pdf.EncryptPDFFile sNomFichier, sOutputCrypt, Crypt
        Set Pdf = Nothing
     
        Set Crypt = Nothing
    End Sub
     
    Sub GénérerPDF()
    Dim sNomPdf As String, sPdf As String
    Dim sDossier As String
    Dim sNomCrypt As String
    Dim FSO As Object
     
        sDossier = ActivePresentation.Path
     
        sNomPdf = Left$(ActivePresentation.Name, InStr(ActivePresentation.Name, ".") - 1) & ".pdf"
        sPdf = sDossier & "\" & sNomPdf
     
        ActivePresentation.ExportAsFixedFormat sPdf, ppFixedFormatTypePDF, ppFixedFormatIntentPrint
     
        sNomCrypt = sDossier & "\" & "Tempo.pdf"
        EncryptPDFsPdf, sNomCrypt
        Set FSO = CreateObject("Scripting.FileSystemObject")
        If FSO.FileExists(sPdf) Then Kill sPdf
        If FSO.FileExists(sNomPdf) Then Kill sNomPdf
        Name sNomCrypt As sNomPdf
        Set FSO = Nothing
    End Sub

  7. #7
    Membre éprouvé Avatar de graphikris
    Homme Profil pro
    Pas tres doué
    Inscrit en
    Décembre 2012
    Messages
    1 222
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Pas tres doué
    Secteur : Conseil

    Informations forums :
    Inscription : Décembre 2012
    Messages : 1 222
    Par défaut
    Merci Kiki 29

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [AC-2007] Comment Imprimer dans PDF mais protégé
    Par tibofo dans le forum VBA Access
    Réponses: 2
    Dernier message: 03/08/2010, 13h37
  2. Imprimer un PDF directement avec PHP
    Par King_T dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 11/05/2006, 01h02
  3. Imprimer un PDF en javascript
    Par shoushinye dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 28/10/2005, 09h48
  4. VBA/Word/Excel97/Imprimer un pdf sans ouvrir acrobat
    Par ouskel'n'or dans le forum VBA Word
    Réponses: 2
    Dernier message: 28/09/2005, 21h40
  5. [PDF] Imprimer un pdf
    Par Magguy dans le forum Documents
    Réponses: 3
    Dernier message: 21/01/2005, 09h08

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo