Date: prev next · Thread: first prev next last
2021 Archives by date, by thread · List index


code définitif pour réaliser une exportation PDF d'une zone à imprimer :

Sub ExportPDF

    Dim oDoc As Object , Feuille As Object, Cellule As Object, ZonePrint As Object
    Dim Chemin As String, Fichier As String
    Dim adressePdfURL As String
    Dim propFich(1) As New
    Dim filterProps(2) As New

    oDoc = ThisComponent
    Feuille = oDoc.Sheets.getByName("Facture")
    Cellule = Feuille.getCellRangeByName ("C2")

    Fichier = Cellule.getString & ".pdf"
    Chemin = "D:\Libre Office\LOCalc\AFPP-Calc\Calc_spécial"

    adressePdfURL =    convertToURL(Chemin & "\" & Fichier)
    ZonePrint = Feuille.getCellRangeByName("A1:G17")

    filterProps(0).Name = "Selection"
    filterProps(0).Value = ZonePrint
    filterProps(1).Name = "CompressMode"
    filterProps(1).Value = 1

    propFich(0).Name = "FilterName"
    propFich(0).Value = "calc_pdf_Export"
    propFich(1).Name = "FilterData"
    propFich(1).Value = filterProps()

    oDoc.StoreToURL(adressePdfURL, propFich())

    MsgBox("Fin export pdf")

Merci à Michel

Michel Blanchard
ALGOL - Formation - Coaching Bureautique
/5 rue de Vélantan/
*37130* Mazières de Touraine
Envoyez un mail à pour vous désinscrire
Les archives de la liste sont disponibles à
Privacy Policy:


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.