none
How read cell color of a table cell from Powerpoint slide using Interop.Powerpoint RRS feed

  • Question

  • Hi,

    I am trying to build a program to extract all information available in all the Tables in the slide. I am able to extract the text, however, I am not able to extract the status which is a color, for ex.: red, yellow, green

    I can find the option to find the Font color but not the cell color. Below are the objects that I am using.

    Table.row.cells[0].shape

    regards,

    Ajay Singh


    Thanks & Regards Ajay Singh

    • Moved by CoolDadTx Friday, October 27, 2017 2:38 PM Office related
    Friday, October 27, 2017 12:30 PM

Answers

  • Hi AjSingh,

    You could try to get BackColor or ForeColor from Shape.Fill property.

    Such as

    table.Rows[1].Cells[1].Shape.Fill.ForeColor
    
    table.Rows[1].Cells[1].Shape.Fill.BackColor

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Terry Xu - MSFT Wednesday, November 1, 2017 1:19 AM
    • Marked as answer by AjSingh Tuesday, November 7, 2017 12:40 PM
    Monday, October 30, 2017 6:34 AM
  • Hi AjSingh,

    What's the current state of your issue? Has your original issue been resolved?

    If it has, I would suggest you mark helpful reply or provide your solution to help other developers use this forum efficiently. If not, please feel free to let us know your current issue.

    Thanks for understanding.

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by AjSingh Tuesday, November 7, 2017 12:40 PM
    Wednesday, November 1, 2017 1:20 AM

All replies

  • You could try Spire.Presentation to get the color of a table cell.

    //create Presentation instance and load file
    Presentation presentation = new Presentation();
    presentation.LoadFromFile("table.pptx");
    
    //get table
    ITable table = null;          
    foreach (IShape shape in presentation.Slides[0].Shapes)
    {
        if (shape is ITable)
        {
            table = (ITable)shape;
            //get cell color
            Console.WriteLine(table[1,1].FillFormat.SolidColor.Color.Name);
         }
    }
    

    Monday, October 30, 2017 3:45 AM
  • Hi AjSingh,

    You could try to get BackColor or ForeColor from Shape.Fill property.

    Such as

    table.Rows[1].Cells[1].Shape.Fill.ForeColor
    
    table.Rows[1].Cells[1].Shape.Fill.BackColor

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Terry Xu - MSFT Wednesday, November 1, 2017 1:19 AM
    • Marked as answer by AjSingh Tuesday, November 7, 2017 12:40 PM
    Monday, October 30, 2017 6:34 AM
  • Thanks for the reply Terry!!. Will try and update.

    Thanks & Regards Ajay Singh

    Monday, October 30, 2017 7:48 AM
  • Thanks for the reply Ezreal!! and appreciate the help, however, we are not looking for a paid solution :(

    Thanks & Regards Ajay Singh

    Monday, October 30, 2017 7:49 AM
  • Hi AjSingh,

    What's the current state of your issue? Has your original issue been resolved?

    If it has, I would suggest you mark helpful reply or provide your solution to help other developers use this forum efficiently. If not, please feel free to let us know your current issue.

    Thanks for understanding.

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by AjSingh Tuesday, November 7, 2017 12:40 PM
    Wednesday, November 1, 2017 1:20 AM