3 Dim oSettings(11) as new com.sun.star.beans.PropertyValue
4 oSettings(0).Name = "JPEGCompression"
5 oSettings(0).Value= True
6 oSettings(1).Name = "JPEGQuality"
8 oSettings(2).Name = "RemoveCropArea"
9 oSettings(2).Value= True
10 oSettings(3).Name = "ImageResolution"
11 oSettings(3).Value= 90
12 oSettings(4).Name = "OLEOptimization"
13 oSettings(4).Value= False
14 oSettings(5).Name = "OLEOptimizationType"
16 oSettings(6).Name = "DeleteUnusedMasterPages"
17 oSettings(6).Value= True
18 oSettings(7).Name = "DeleteHiddenSlides"
19 oSettings(7).Value= True
20 oSettings(8).Name = "DeleteNotesPages"
21 oSettings(8).Value= True
22 oSettings(9).Name = "SaveAs"
23 oSettings(9).Value= true
24 oSettings(10).Name = "EmbedLinkedGraphics"
25 oSettings(10).Value = false
26 oSettings(11).Name = "SaveAsURL"
27 oSettings(11).Value = ""
28 oSettings(12).Name = "FilterName"
29 oSettings(12).Value = "impress8"
33 Dim oArg(0) as new com.sun.star.beans.PropertyValue
34 oArg(0).Name = "Settings"
35 oArg(0).Value= oSettings
38 Dim oPresentations(17) as String
39 oPresentations( 0)="d:\data\sunpresentations\01-22-07SunIntelAnnouncementPresentation,01-22-2007.star_impress_8x.odp"
40 oPresentations( 1)="d:\data\sunpresentations\01_Schwartz_SAS_VF.odp"
41 oPresentations( 2)="d:\data\sunpresentations\CorporateSocialResponsibilityCustomerPresentation,02-12-2007.star_impress_8x.odp"
42 oPresentations( 3)="d:\data\sunpresentations\Current-ProjectBlackboxCustomerPresentation,03-07-2007.star_impress_8x.odp"
43 oPresentations( 4)="d:\data\sunpresentations\JavaSE6CustomerPresentation,12-11-2006(2).star_impress_8x.odp"
44 oPresentations( 5)="d:\data\sunpresentations\JavaSE6CustomerPresentation,12-11-2006.star_impress_8x.odp"
45 oPresentations( 6)="d:\data\sunpresentations\NetworkComputingLaunchPresentation,Q22006,Washington,DC,05-08-2006.star_impress_8x.odp"
46 oPresentations( 7)="d:\data\sunpresentations\ProjectBlackboxTechnicalPresentation-NDAONLY,11-09-2006.star_impress_8x.odp"
47 oPresentations( 8)="d:\data\sunpresentations\ScottMcNealy,IntlAssocofPrivacyProfessionals)ConferenceOpeningKeynote,'PlayingonSunday-GettingPrivacyRight',March,8,2007,Washington,DC,,03-08-2007.star_impress_8x.odp"
48 oPresentations( 9)="d:\data\sunpresentations\Sun'sStoragetekAcademy-JonathanSchwartzTheSky'sTheLimit!,February,292007,SanFrancisco,CA,02-28-2007.star_impress_8x.odp"
49 oPresentations(10)="d:\data\sunpresentations\SunAnalystSummit2007(SAS)-DonGranthamExecutingonStrategy,February,6,2007,SanFrancisco,CA,02-07-2007.star_impress_8x.odp"
50 oPresentations(11)="d:\data\sunpresentations\SunConsultingServicesPortfolio-Presentation,03-17-2006.star_impress_6x.sxi"
51 oPresentations(12)="d:\data\sunpresentations\SunFedOpenYourMindandSunFedTechDayatGTSI,ScottMcNealy,January23and24,2007,Washington,DC,01-23-2007.star_impress_8x.odp"
52 oPresentations(13)="d:\data\sunpresentations\SunFedTechDaysatAccenture,ScottMcNealy,January24,2007,Washington,DC,01-24-2007.star_impress_8x.odp"
53 oPresentations(14)="d:\data\sunpresentations\SunManagedServicesGoldenPitch,03-22-2007.star_impress_8x.odp"
54 oPresentations(15)="d:\data\sunpresentations\SunServicesEducationServicesGeneralPresentation,01-11-2006.star_impress_6x.sxi"
55 oPresentations(16)="d:\data\sunpresentations\SunSystemPacks-CustomerReadyPresentation,01-23-2007.star_impress_8x.odp"
56 oPresentations(17)="d:\data\sunpresentations\U.S.SalesMeetingCustomerPresentation(08-01-2006),08-01-2006.odp"
59 url=oPresentations( I )
60 oSettings(11)=url+string( I, 2 )
61 url=converttourl( url )
62 optimize( url, oArg() )
67 Sub Optimize( url as String, oArg )
69 Dim oPPPOptimizerDialog as Object
70 Dim oUrl as new com.sun.star.util.URL
72 oTrans = createUNOService("com.sun.star.util.URLTransformer")
73 oUrl.Complete = "vnd.com.sun.star.comp.PPPOptimizer:optimize"
74 oTrans.parsestrict(oUrl)
77 Dim FileProperties(0) As New com.sun.star.beans.PropertyValue
78 oSM = CreateObject("com.sun.star.ServiceManager")
79 oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
80 oDoc = oDesk.loadComponentFromURL( url, "_blank", 0, FileProperties() )
82 Dim oInitialization( 0 ) as Object
83 oInitialization(0) = oDoc.getCurrentController.getFrame
84 oPPPOptimizerDialog = createUNOservice("com.sun.star.comp.PPPOptimizerImp")
85 oPPPOptimizerDialog.initialize( oInitialization )
86 oPPPOptimizerDialog.dispatch(oURL, oArg)