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

convert e sheet to pdf

Post new topic   Reply to topic Forum Index -> Macros and API
View previous topic :: View next topic  
Author Message

PostPosted: Mon Mar 29, 2004 6:12 am    Post subject: convert e sheet to pdf Reply with quote


I would like to create a macro which convert a sheet(only one ) of document calc in pdf.

Can you help me?

Back to top
Power User
Power User

Joined: 10 Feb 2004
Posts: 56
Location: Frankfurt/Main Germany

PostPosted: Thu Apr 01, 2004 1:25 am    Post subject: Reply with quote

Hello BabyDoll,

This code from Andrew Pitonyak's Macro Dokument is the first step for your task.


'Author: Stephan Wunderlich []
Sub CopySpreadsheet
  firstDoc = ThisComponent
  selectSheetByName(firstDoc, "Sheet2")
  secondDoc = StarDesktop.loadComponentFromUrl("private:factory/scalc","_blank",0,dimArray())
  selectSheetByName(secondDoc, "inserted")
End Sub

Sub selectSheetByName(document, sheetName)
End Sub

Sub dispatchURL(document, aURL)
  Dim noProps()
  Dim URL as new

  frame = document.getCurrentController().getFrame()
  URL.Complete = aURL
  transf = createUnoService("")

  disp = frame.queryDispatch(URL, "", _
  disp.dispatch(URL, noProps())
End Sub

Now use the FilterOptions to save the Document as a pdf. Descriebed in detail from DannyB
in this post or in the Code Snipplet Area.:

Hope this helped you. You can find Andrew Pitonyaks Document here:

Peter Biela
Question Who is John Galt? - Ayn Rand Question
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Forum Index -> 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