Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8099151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:18:37+00:00 2026-06-05T22:18:37+00:00

I am using openXML and C# to generate a powerpoint slide but I can’t

  • 0

I am using openXML and C# to generate a powerpoint slide but I can’t seem to figure out how to change / set the text size and color. Is this possible and are there any example as I can’t seem to find any with googling?

I am building out a table (similar to this: http://blogs.msdn.com/b/brian_jones/archive/2009/08/13/adding-repeating-data-to-powerpoint.aspx) and I want to change a number of things in each cell (fontsize, font color, backcolor of cell).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:18:39+00:00Added an answer on June 5, 2026 at 10:18 pm

    Your comments state this Formatting is for a Table inside a PowerPoint slide.

    Assumptions
    I am assuming you have already created the table, table rows, table cells, and display text.
    Also assuming you have everything working and now you want to add formatting.

    If you want to format your Text and Cells, you may do so using the following:

    //Create the TableCell for the PowerPoint table you are building.
    A.TableCell tableCell3 = new A.TableCell();
    A.TextBody textBody5 = new A.TextBody();
    A.BodyProperties bodyProperties5 = new A.BodyProperties();//Created but not modified.
    A.ListStyle listStyle5 = new A.ListStyle();//Created but not modified.
    A.Paragraph paragraph5 = new A.Paragraph();
    
    //First Word: "Hello" with Font-Size 60x and Font-Color Green.
    A.Run run1 = new A.Run();
    A.RunProperties runProperties1 = new A.RunProperties() { Language = "en-US", FontSize = 6000, Dirty = false, SmartTagClean = false };//Set Font-Size to 60px.
    A.SolidFill solidFill1 = new A.SolidFill();
    A.RgbColorModelHex rgbColorModelHex1 = new A.RgbColorModelHex() { Val = "00B050" };//Set Font-Color to Green (Hex "00B050").
    solidFill1.Append(rgbColorModelHex1);
    runProperties1.Append(solidFill1);
    A.Text text1 = new A.Text();
    text1.Text = "Hello";
    run1.Append(runProperties1);
    run1.Append(text1);
    
    //Second Word: "World" with Font-Size 60x and Font-Color Blue.
    A.Run run2 = new A.Run();
    A.RunProperties runProperties2 = new A.RunProperties() { Language = "en-US", FontSize = 6000, Dirty = false, SmartTagClean = false };//Set Font-Size to 60px.
    A.SolidFill solidFill2 = new A.SolidFill();
    A.RgbColorModelHex rgbColorModelHex2 = new A.RgbColorModelHex() { Val = "0070C0" };//Set Font-Color to Blue (Hex "0070C0").
    solidFill2.Append(rgbColorModelHex2);
    runProperties2.Append(solidFill2);
    A.Text text2 = new A.Text();
    text2.Text = " World";
    run2.Append(runProperties2);
    run2.Append(text2);
    
    //This element specifies the text run properties that are to be used if another run is inserted after the last run specified.
    //This effectively saves the run property state so that it can be applied when the user enters additional text.
    //If this element is omitted, then the application can determine which default properties to apply.
    //It is recommended that this element be specified at the end of the list of text runs within the paragraph so that an orderly list is maintained.
    //  Source: http://msdn.microsoft.com/en-us/library/documentformat.openxml.drawing.endparagraphrunproperties.aspx
    //Set the default formatting for words entered after "Hello World" with Font-Size 60x and Font-Color Blue.
    A.EndParagraphRunProperties endParagraphRunProperties5 = new A.EndParagraphRunProperties() { Language = "en-US", FontSize = 6000, Dirty = false };//Set Font-Size to 60px.
    A.SolidFill solidFill3 = new A.SolidFill();
    A.RgbColorModelHex rgbColorModelHex3 = new A.RgbColorModelHex() { Val = "0070C0" };//Set Font-Color to Blue (Hex "0070C0").
    solidFill3.Append(rgbColorModelHex3);
    endParagraphRunProperties5.Append(solidFill3);
    
    paragraph5.Append(run1);//Append Run: "Hello".
    paragraph5.Append(run2);//Append Run: " World".
    paragraph5.Append(endParagraphRunProperties5);//Append formmatting for any text the user may enter after the words "Hello World".
    textBody5.Append(bodyProperties5);//Created but not modified.
    textBody5.Append(listStyle5);//Created but not modified.
    textBody5.Append(paragraph5);//Append Paragraph: "Hello World"
    
    //TableCell Properties.  Set Background-Color to Red (Hex "FF0000").
    A.TableCellProperties tableCellProperties3 = new A.TableCellProperties();
    A.SolidFill solidFill4 = new A.SolidFill();
    A.RgbColorModelHex rgbColorModelHex4 = new A.RgbColorModelHex() { Val = "FF0000" };//Red Background for Single TableCell.
    solidFill4.Append(rgbColorModelHex4);
    tableCellProperties3.Append(solidFill4);//Append Red Background.
    
    tableCell3.Append(textBody5);
    tableCell3.Append(tableCellProperties3);
    

    I cheated and used the “Open XML SDK 2.0 Productivity Tool for Microsoft Office“.
    I simply created a new PowerPoint file, added a table, and edited the 3rd Cell.
    Then I ran the SDK tool and reflected the code on “[]/ppt/presentation.xml“.
    I added comments to the reflected code so that you may understand it better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've generated a .xlsx spreadsheet in C# using the OpenXML SDK, but can't figure
How can I get the second column with the same column name using OPENXML
I am creating Excel using DocumentFormat.OpenXml in ASP.Net. Can anybody have idea how can
I did insert an image using the OpenXML SDK API .. however i can
I am trying to find a SDK that can generate PDF from OpenXml. I
I'm loading an XML in SQL using OpenXML while declaring the variable the max
I have created an Excel document using OpenXml SDK 2.0, now I have to
I am looking for alternatives to using openxml for a server-side word automation project.
I created a docx document using OpenXML SDK. It contains group content controls to
Folks, We have been using OpenXml APIs found in System.IO.Packaging for creating a package

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.