Remove Print Ranges

(3 votes)

When you open Microsoft Excel files (xls) in Calc, it may contain several print ranges. If you want to remove all print ranges, you will have to remove the print range in each sheet individually. This extension remove the print ranges from all sheets.

Download extension
Operating System: System Independent
Official release: 1.0.1
Date: 2009-Oct-28
Size: 14.09 KB
License: opensource | Read license
Further product information: Screenshots | Product details

Comments

Translation to spanish

And maybe, other languages.

Excelent idea. Change the code and the extension send the message to spanish. The translations to german, portuguese, italian and french, I do it with google translator. Maybe the people can help to correct the translation.

Sub RemovePrintAreas
Dim args() As new com.sun.star.table.CellRangeAddress

If Msgbox(mensaje, MB_YESNO, "Remove Print Ranges") = IDYES Then
For i = 0 To ThisComponent.Sheets.Count - 1
s = ThisComponent.Sheets.getByIndex(i)
s.setPrintAreas(args())
Next
End If
End Sub

Function Mensaje(caso As Integer) As String
Dim oLibs As Object
oLibs = GlobalScope.BasicLibraries
If NOT oLibs.isLibraryLoaded("Tools") Then oLibs.loadLibrary("Tools")
Dim oLocale as New com.sun.star.lang.Locale
oLocale = GetStarOfficeLocale()
oLocale = ThisComponent.CharLocale
Select Case oLocale.Language
Case "es"
Mensaje = "¿Desea eliminar los rangos de impresión de todas las hojas?"
Case "du"
Mensaje = "Wollen Sie den Druck reicht in alle Blätter entfernen?"
Case "fr"
Mensaje = "Voulez-vous supprimer les zones d'impression dans tous les draps?"
Case "it"
Mensaje = "Vuoi rimuovere gli intervalli di stampa in tutti i fogli?"
Case "pt"
Mensaje = "Você quer remover os intervalos de impressão em todas as folhas?"
Case Else
Mensaje = "Do you want to remove the print ranges in all sheets?"
End Select
End Function

I probe the code and work fine.

Eduardo Moreno
TOKONHU de México

Translation to French

Text should be : "Voulez-vous supprimer les zones d'impression dans toutes les feuilles?"

Re Translation to spanish

I remove "oLocale = ThisComponent.CharLocale" line to use UI locale instead of char locale because It can be used for CTL and Asian.

_/|\_ Tantai Thanakanok. Open Source Development Co., Ltd.
Tel: +66 38 311816, Fax: +66 38 773128, http://www.osdev.co.th/