Categories
Common

Color Blind of ChartObject

To save the trees, it can be very usefull to switch the chart from a colored version to a black white one. this can be done with the follwing macro and a button to execute…

SUB ColorBlind
    for j = 0 to ActiveDocument.NoOfSheets - 1
        Set s = ActiveDocument.GetSheet(j)
        for i=0 to s.NoOfSheetObjects-1
            Set p = ActiveDocument.GetSheetObject(s.SheetObjects(i).getObjectId)

            if p.getObjectType = 12 THEN
                'MsgBox(p.getObjectType)
                op = p.GetProperties
                IF op.ChartProperties.HatchedBrushesOnScreen = false THEN
                    op.ChartProperties.HatchedBrushesOnScreen = true
                ELSE
                    op.ChartProperties.HatchedBrushesOnScreen = false
                END IF
                p.SetProperties op
            end if
        next
       next
END SUB

Leave a Reply