Visio 2010 Programmatically change Shape fill color using C#

Discussion in 'Visio' started by Ilan Bar, Aug 13, 2015.

  1. Ilan Bar

    Ilan Bar

    Jul 8, 2015
    Likes Received:
    From my C# code, I am trying alter a shape's background to highlight it in response to a given criteria. I researched all visio forums and came up with the following methods:

    first method:

    second method:

    ArrayList sourceStream =newArrayList();ArrayList formula =newArrayList();



    Array arrSourceStream = sourceStream.ToArray(typeof(short));Array arrFormula = formula.ToArray();

    shape.SetFormulas(ref arrSourceStream,ref arrFormula,(short)VisGetSetArgs.visSetUniversalSyntax);

    None of the methods resulted in change in the shape's color. Additional information:
    1) trying to change shape's line color or pattern by changing the VisCellIndices enum gives the same result - no change
    2) I am able to add custom cell properties to the shape
    3) I am able to alter shape's text using the "Text" property

    I am completely stuck!! any ideas?
    Regards, Ilan
    Ilan Bar, Aug 13, 2015
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.