Bonjour,
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 com.sun.star.beans.PropertyValue
Dim filterProps(2) As New com.sun.star.beans.PropertyValue
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
A+
--
Michel Blanchard
ALGOL - Formation - Coaching Bureautique
/5 rue de Vélantan/
*37130* Mazières de Touraine
--
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à https://listarchives.libreoffice.org/fr/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
- [fr-users] Export PDF · Algol formations
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.