Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

enregistrer en pdf

jojolatrouvaille

XLDnaute Nouveau
bonjour,

je voudrai que la macro enregistre le bordereau de livraison en pdf et quelle respecte la mise en page du bordereau de livraison. Merci de vos conseil à bientôt
 

kiki29

XLDnaute Barbatruc
Re : enregistrer en pdf

Salut, @jojo : à partir d'Office 2007 SP2 le format PDF est inclus en natif dans Office, et le macro recorder t'apportera une réponse. Sinon il te faudra un logiciel externe du style PDFCreator 1.7.3
 

don_pets

XLDnaute Occasionnel
Re : enregistrer en pdf

Comme le dis si justement kiki, en fonction de ta version d'Excel il te faudra installer une version de pdf creator de manière à imprimer en format pdf. Pour une telle solution je te propose ce code :

Code:
'Mise en page
Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .PrintTitleRows = ""
        .PrintTitleColumns = ""
    End With
    Application.PrintCommunication = True
    ActiveSheet.PageSetup.PrintArea = ""
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .LeftHeader = ""
        .CenterHeader = ""
        .RightHeader = ""
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = Application.InchesToPoints(0.118110236220472)
        .RightMargin = Application.InchesToPoints(0.118110236220472)
        .TopMargin = Application.InchesToPoints(0.15748031496063)
        .BottomMargin = Application.InchesToPoints(0.15748031496063)
        .HeaderMargin = Application.InchesToPoints(0.31496062992126)
        .FooterMargin = Application.InchesToPoints(0.31496062992126)
        .PrintHeadings = False
        .PrintGridlines = False
        .PrintComments = xlPrintNoComments
        .PrintQuality = 600
        .CenterHorizontally = False
        .CenterVertically = False
        .Orientation = xlPortrait
        .Draft = False
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
        .PrintErrors = xlPrintErrorsDisplayed
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .ScaleWithDocHeaderFooter = True
        .AlignMarginsHeaderFooter = True
        .EvenPage.LeftHeader.Text = ""
        .EvenPage.CenterHeader.Text = ""
        .EvenPage.RightHeader.Text = ""
        .EvenPage.LeftFooter.Text = ""
        .EvenPage.CenterFooter.Text = ""
        .EvenPage.RightFooter.Text = ""
        .FirstPage.LeftHeader.Text = ""
        .FirstPage.CenterHeader.Text = ""
        .FirstPage.RightHeader.Text = ""
        .FirstPage.LeftFooter.Text = ""
        .FirstPage.CenterFooter.Text = ""
        .FirstPage.RightFooter.Text = ""
    End With
'Impression avec choix de l'imp
    Application.PrintCommunication = True
Sheets("feuil1").Range("A1:F52").Application.Dialogs(xlDialogPrint).Show , , , 3

pets
 

Discussions similaires

Réponses
1
Affichages
264
Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…