Sub WMFExport DIM oDoc As Object DIM oDocCtrl As Object oDoc = ThisComponent DIM aFilterData( 1 ) As new com.sun.star.beans.PropertyValue DIM aDescriptor( 1 ) As new com.sun.star.beans.PropertyValue aDescriptor(0).Name = "FilterName" aDescriptor(0).Value = "WMF" sFileNameExt = ".WMF" aDescriptor(1).Name = "URL" spath = oDoc.URL oFilter = CreateUnoService("com.sun.star.drawing.GraphicExportFilter") nNumPages = oDoc.DrawPages.getCount() For nPage = 0 To nNumPages-1 oDrawPage = oDoc.getDrawPages().getByIndex( nPage ) nNumShapes = oDrawPage.getCount() if nNumShapes > 0 then oSelection =createUnoService( "com.sun.star.drawing.ShapeCollection" ) For nShape = 0 To nNumShapes - 1 oSelection.add(oDrawPage.getByIndex(nShape)) Next aDescriptor(1).Value = left(spath, len(spath) - 4) + "_" + oDoc.DrawPages.ElementNames(nPage) + ".wmf" oFilter.setSourceDocument( oSelection ) oFilter.filter( aDescriptor() ) end if Next End Sub Sub EpsExport DIM oDoc As Object DIM oDocCtrl As Object oDoc = ThisComponent DIM aDescriptor( 3 ) As new com.sun.star.beans.PropertyValue Dim aFilterData( 5 ) As new com.sun.star.beans.PropertyValue aFilterData(0).Name = "Level" '1=PS level 1, 2=PS level 2 aFilterData(0).Value = 1 aFilterData(1).Name = "ColorFormat" '1=color, 2=grayscale aFilterData(1).Value = 1 aFilterData(2).Name = "TextMode" '0=glyph outlines, 1=no glyph outlines, see ooo bug 7918 aFilterData(2).Value = 1 aFilterData(3).Name = "Preview" '0=none,1=TIFF,2=EPSI,3=TIFF+EPSI aFilterData(3).Value = 0 aFilterData(4).Name = "CompressionMode" ' 1=LZW, 2=none aFilterData(4).Value = 2 aDescriptor(0).Name = "MediaType" aDescriptor(0).Value = "application/postscript" aDescriptor(1).Name = "URL" aDescriptor(2).Name = "FilterData" aDescriptor(2).Value = aFilterData() spath = oDoc.URL oFilter = CreateUnoService("com.sun.star.drawing.GraphicExportFilter") nNumPages = oDoc.DrawPages.getCount() For nPage = 0 To nNumPages-1 oDrawPage = oDoc.getDrawPages().getByIndex( nPage ) nNumShapes = oDrawPage.getCount() if nNumShapes > 0 then oSelection =createUnoService( "com.sun.star.drawing.ShapeCollection" ) For nShape = 0 To nNumShapes - 1 oSelection.add(oDrawPage.getByIndex(nShape)) Next aDescriptor(1).Value = left(spath, len(spath) - 4) + "_" + oDoc.DrawPages.ElementNames(nPage) + ".eps" oFilter.setSourceDocument( oSelection ) oFilter.filter( aDescriptor() ) end if Next End Sub