View Single Post
Old 24-07-2006, 10:45
Posts: n/a

At least, I did it by myself, I am not a coder, but with some cut and paste some trial and error here it is the macro:
Change all the bitmap mode to grayscale (PowerClipped bitmaps too).

Any better code are welcome.

Sub ChangeMode()

Dim s As Shape, sp As Shape
Dim pwc As PowerClip
Dim ChangeCountPowerClip As Integer
Dim ChangeCount As Integer

ChangeCountPowerClip = 0
ChangeCount = 0

For Each s In ActiveDocument.ActivePage.Shapes
    Set pwc = Nothing
    Set pwc = s.PowerClip
    If Not pwc Is Nothing Then
        For Each sp In pwc.Shapes
            If sp.Type = cdrBitmapShape Then
                If sp.Bitmap.Mode <> cdrGrayscaleImage Then
                   sp.Bitmap.ConvertTo cdrGrayscaleImage
                   ChangeCountPowerClip = ChangeCountPowerClip + 1
                End If
            End If
        Next sp
    End If
    If s.Type = cdrBitmapShape Then
        If s.Bitmap.Mode <> cdrGrayscaleImage Then
            s.Bitmap.ConvertTo cdrGrayscaleImage
            ChangeCount = ChangeCount + 1
        End If
    End If

Next s
MsgBox ChangeCount & " Bitmap and " & ChangeCountPowerClip & " inside PowerClip"
End Sub
Reply With Quote