Color Each Segment Of MsoShapeBevel

  • Hello,
    msoShapeBevel results in a shape with 5 sections. How can I color top and bottom in one color, left and right in another and the center in a third color/or blank?
    Thank you,
    Stefan


    Code
    Sub test()
    Worksheets(3).Shapes.AddShape msoShapeBevel, 50, 50, 100, 200
    End Sub
  • Re: Msoshapebevel - Change Color


    Hello,


    Thank you for your reply.


    I have been trying different approaches, indluding "msoShapeIsoscelesTriangle" and "msoShapeTrapezoid".


    I only need the four outside trapezoids as you identified correctly. I need to be able to color them individually - as in attached image. What shapes are in the backgroup does not matter as the square/rectangle center will be covered up, potentialy hiding part of the shapes used to achieve the border effect.


    I dont know how to line these individual shapes up so that the corner pieces line up. Any suggestion?


    Thank you,


    Stefan

  • Re: Msoshapebevel - Change Color


    Getting the inner corners to line up is a pain. I can't figure out how to do it with AutoShapes, but it looks like Polyline would work. Enter polyline in the VBEditor help system. I think that will work for you.

  • Re: Msoshapebevel - Change Color


    Hello,
    I have, briefly at this point, looked at your suggestion.


    At this point I find the following quite promising. - I created four shapes (trapezoids) manually, named them, and then grouped them together. Now I can color them any which way I want by calling the respective shapes name - see at the end. Looks and generally behaves as the beveled shape. I can manually change the size for the group by draging the handles, just as usual. - So far so good.


    Now I need to figure out how I can resize the group automatically. I can get its current size (I found the following snippet helpful):


    Code
    For Each shp In Sheets("sheet5").Shapes
       myleft = shp.Left
       mytop = shp.Top
       mywidth = shp.Width
       myheight = shp.height
    Next shp
    MsgBox mywidth & " " & myheight


    How can I resize using custom sizes?


    Code
    Selection.ShapeRange.ScaleWidth 1.75, msoFalse, msoScaleFromTopLeft '1.75 stands for resizing to 175% of its original size


    If the current size shows me 50 (width) and 100 (height) and I want it to respectfully be 190 and 75... it seems its just a math problem but I cant get my head around it.


    And, how can I dictate its Top and Left?


    Thank you,


    Stefan


  • Re: Color Each Segment Of MsoShapeBevel


    This works for me.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!