

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
2 messages in org.openoffice.fr.prog[prog] Problème d'impression nombre d...| From | Sent On | Attachments |
|---|---|---|
| Philippe Bolton | Dec 1, 2008 12:32 am | |
| Bernard Marcelly | Dec 1, 2008 4:53 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | [prog] Problème d'impression nombre d'exemplaires | Actions... |
|---|---|---|
| From: | Philippe Bolton (phil...@flute-a-bec.com) | |
| Date: | Dec 1, 2008 12:32:55 am | |
| List: | org.openoffice.fr.prog | |
Bonjour, J'ai un problème concernant l'impression d'un document calc. En utilisant le code ci-dessous (une partie de la macro Open Office Basic) si je demande l'impression d'un exemplaire j'obtiens ce que je demande, mais si je demande plus d'un exemplaire le programme en imprime deux fois plus. Pourriez-vous me dire où se trouve l'erreur. Le code a été écrit à partir d'une macro enregistrée automatiquement
sub ImpressionCatalogueEuroFrancais rem ---------------------------------------------------------------------- rem define variables dim documentwebpdf as object dim lesfeuilles as object dim feuille as object dim zone as object dim dispatcher as object Dim sText As String, nbrecopies as single dim textexemplaires as string, textrectoimprimes as string documentwebpdf=thisComponent lesfeuilles=documentwebpdf.sheets feuille=lesfeuilles.getByName("catZoneEuroFrançais") zone=feuille.getcellrangebyname("A1:I35") documentwebpdf.currentcontroller.Select(zone) sText = InputBox ("Entrez le nombre d'exemplaires :","Catalogue Zone Euro Français") nbrecopies=int(sText) dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") documentwebpdf = ThisComponent.CurrentController.Frame if nbrecopies>0 then
if nbrecopies = 1 then textexemplaires = " exemplaire" else textexemplaires = " exemplaires" if MsgBox ("Confirmer l'impression de " & nbrecopies & textexemplaires & " du recto. ", 1, "Impression Catalogue Zone Euro Français")= 2 then goto fin rem ---------------------------------------------------------------------- rem get access to the documentwebpdf
rem ---------------------------------------------------------------------- dim args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "ToPoint" args2(0).Value = "$A$1:$I$35"
dispatcher.executeDispatch(documentwebpdf, ".uno:GoToCell", "", 0, args2())
rem ---------------------------------------------------------------------- dispatcher.executeDispatch(documentwebpdf, ".uno:DefinePrintArea", "", 0, Array())
rem ---------------------------------------------------------------------- dim args4(2) as new com.sun.star.beans.PropertyValue args4(0).Name = "Copies" args4(0).Value = nbrecopies args4(1).Name = "Selection" args4(1).Value = true args4(2).Name = "Collate" args4(2).Value = false
dispatcher.executeDispatch(documentwebpdf, ".uno:Print", "", 0, args4()) end if
Merci d'avance
-- Philippe Bolton
www.flute-a-bec.com







