Alan Yaniger ha scritto:
Hi everyone,
1.
What would be simple OOo Basic code to print the current page in Writer?
http://www.mail-archive.com/[email protected]/msg10718.html
Paolo Mantovani
Wed, 09 Apr 2008 15:03:29 -0700
REM ***** BASIC *****
Sub PrintCurrentPage
Dim oDoc As Object
Dim oDocView As Object
Dim iCurPage As Integer
oDoc = ThisComponent
oDocView = oDoc.getCurrentController()
iCurPage = oDocView.ViewCursor.Page
Dim mPrintOpts(0) As New com.sun.star.beans.PropertyValue
mPrintOpts(0).Name = "Pages"
mPrintOpts(0).Value = """" & iCurPage & """"
oDoc.print(mPrintOpts())
End Sub
http://www.pitonyak.org/AndrewMacro.odt
5.6.1. Print Current Page
Listing 5.8: Print only the current page.
Dim aPrintOps(0) As New com.sun.star.beans.PropertyValue
oDoc = ThisComponent
oVCurs = oDoc.CurrentController.getViewCursor()
aPrintOps(0).Name = "Pages"
aPrintOps(0).Value = trim(str(oVCurs.getPage()))
oDoc.print(aPrintOps())
ciao
Beppe
2.
Is there a way that I could use a macro to change the default in the
Writer print dialog from "All Pages" to "Pages" (which defaults to the
current page)?
Thanks,
Alan
--
le nuvole non hanno regole,
perchè non hanno mai rinunciato
alla libertà di sognare.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]