OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

PDF export for Calc - sheet/range selection

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
oliverbass
Newbie
Newbie


Joined: 25 Jan 2006
Posts: 3

PostPosted: Thu Feb 02, 2006 2:09 am    Post subject: PDF export for Calc - sheet/range selection Reply with quote

Hello all,

The following macro saves my Calc file as .ini file and exports it as a PDF file
I would like to export only a specified sheet or a specified range but I don't manage to adapt the macro the proper way.

Could someone help ?

Thanks,

Olivier


Sub smalltest
dim nomfichier as String
dim document as object
dim feuille as Object
document = StarDesktop.getCurrentComponent()
feuille = document.Sheets.getByName ("Feuille1")
nomfichier = feuille.getCellRangeByName("B30").String
msgbox (nomfichier)

rem
rem -------------Enregistrement du fichier .ini
rem
dim args1(2) as new com.sun.star.beans.PropertyValue

args1(0).Name = "FilterName"
args1(0).Value = "Text - txt - csv (StarCalc)"
args1(1).Name = "FilterOptions"
args1(1).Value = "9,34,ANSI"
args1(2).Name = "SelectionOnly"
args1(2).Value = true

document.storeToURL("file:///C:/"+Nomfichier+".ini",args1())

rem
rem -------------Enregistrement du fichier PDF--------------------------
rem
document.storeToURL("file:///C:/"+Nomfichier+".pdf", Array(MakePropertyValue("FilterName", "calc_pdf_Export"))

End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group