baykaone

saveAsJPG

Jan 9th, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub saveAsJPG()
  2.     Dim path As String
  3.     path = CorelScriptTools.GetFileBox("Bitmap files|*.jpg", "Save As", 1, "file.jpg", , "C:\")
  4.     Dim s As Shape
  5.     Set s = ActiveShape
  6.     If s.SizeWidth = 0 Then
  7.     MsgBox "Zaznacz obiekt w dokumencie..."
  8.     Exit Sub
  9.     End If
  10.     Dim expflt As ExportFilter
  11.     Set expflt = ActiveDocument.ExportBitmap( _
  12.                  path, cdrJPEG, cdrSelection, cdrRGBColorImage, _
  13.                  , , 300, 300, cdrNormalAntiAliasing, _
  14.                  False, False, True, False, cdrCompressionJPEG)
  15.     With expflt
  16.         .Progressive = False
  17.         .Optimized = True
  18.         .SubFormat = 0
  19.         .Compression = 10
  20.         .Smoothing = 10
  21.         .Finish
  22.     End With
  23. End Sub
Advertisement
Add Comment
Please, Sign In to add comment