Hello Rony, On Tuesday 13 July 2010, 14:52, Rony G. Flatscher wrote: > The script that I have been trying to tidy up already opened > (loadComponentFromurl) the impress component with a PropertyValue of > ("IsPrintHandout", true), which had no visual effect on the displayed > document.
you were in the wrong way: these settings are not in the document's main settings (querying css.beans.XPropertySet on the document's model), not in the printer settings, not in the MediaDescriptor when loading the document. As explained in http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Drawings/Settings you must instantiate the com.sun.star.document.Settings at the document's factory. > > When printing that impress component I supplied PropertyValues to > XPrintable.print() like > > * ("IsPrintHandout", true) and Dim oDoc as Object oDoc = ThisComponent Dim oDocSettings as Object oDocSettings = oDoc.createInstance("com.sun.star.document.Settings") oDocSettings.setPropertyValue("IsPrintHandout", True) > * ("SlidesPerPage" | "SlidesPerHandout", 2), where "2" was supplied oDocSettings.setPropertyValue("SlidesPerHandout", 6) has no effect, at least I could not see any. If what you are trying to achieve is that the handout page has X number of slides, you will have to play with the Layout property of the HandoutMasterPage, which is implementation specific (AFAIK): ' http://svn.services.openoffice.org/opengrok/xref/DEV300_m84/sd/inc/pres.hxx#97 PRIVATE CONST AUTOLAYOUT_HANDOUT1 = 22 PRIVATE CONST AUTOLAYOUT_HANDOUT2 = 23 PRIVATE CONST AUTOLAYOUT_HANDOUT3 = 24 PRIVATE CONST AUTOLAYOUT_HANDOUT4 = 25 PRIVATE CONST AUTOLAYOUT_HANDOUT6 = 26 PRIVATE CONST AUTOLAYOUT_HANDOUT9 = 31 Sub Main Dim oDoc as Object oDoc = ThisComponent If NOT oDoc.supportsService("com.sun.star.presentation.PresentationDocument") Then MsgBox "This macro works only on presentations", 16, "ERROR" Exit Sub End If Dim oDocSettings as Object oDocSettings = oDoc.createInstance("com.sun.star.document.Settings") oDocSettings.setPropertyValue("IsPrintHandout", True) oDocSettings.setPropertyValue("SlidesPerHandout", 6) Dim oHandout as object oHandout = oDoc.getHandoutMasterPage() 'MsgBox Join(oDoc.getSupportedServiceNames(), Chr(9)), 64, "Supported Services" oHandout.setPropertyValue("Layout", AUTOLAYOUT_HANDOUT6 ) End Sub Regards -- Ariel Constenla-Haile La Plata, Argentina
signature.asc
Description: This is a digitally signed message part.