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 7158031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T12:59:37+00:00 2026-05-28T12:59:37+00:00

Im tasked to use OPEN XML SDK 2.0 and had encountered this problem. Is

  • 0

Im tasked to use OPEN XML SDK 2.0 and had encountered this problem. Is it possible to have different styles for a single CellValue inside a cell something like the picture below:

enter image description here

A: The plain text

B: Bold and Underlined

NOTE: I need both in a single cell only thanks 🙂

  • 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-05-28T12:59:37+00:00Added an answer on May 28, 2026 at 12:59 pm

    Yes that is possible. One way is to format the value that will be inserted into the SharedStringTable. This snippet will create your example above:

            // Creates an SharedStringItem instance and adds its children.
            public SharedStringItem GenerateSharedStringItem()
            {
                SharedStringItem sharedStringItem1 = new SharedStringItem();
    
                Run run1 = new Run();
    
                RunProperties runProperties1 = new RunProperties();
                Bold bold1 = new Bold();
                Underline underline1 = new Underline();
                FontSize fontSize1 = new FontSize(){ Val = 11D };
                Color color1 = new Color(){ Theme = (UInt32Value)1U };
                RunFont runFont1 = new RunFont(){ Val = "Calibri" };
                FontFamily fontFamily1 = new FontFamily(){ Val = 2 };
                FontScheme fontScheme1 = new FontScheme(){ Val = FontSchemeValues.Minor };
    
                runProperties1.Append(bold1);
                runProperties1.Append(underline1);
                runProperties1.Append(fontSize1);
                runProperties1.Append(color1);
                runProperties1.Append(runFont1);
                runProperties1.Append(fontFamily1);
                runProperties1.Append(fontScheme1);
                Text text1 = new Text();
                text1.Text = "Project Name:";
    
                run1.Append(runProperties1);
                run1.Append(text1);
    
                Run run2 = new Run();
    
                RunProperties runProperties2 = new RunProperties();
                FontSize fontSize2 = new FontSize(){ Val = 11D };
                Color color2 = new Color(){ Theme = (UInt32Value)1U };
                RunFont runFont2 = new RunFont(){ Val = "Calibri" };
                FontFamily fontFamily2 = new FontFamily(){ Val = 2 };
                FontScheme fontScheme2 = new FontScheme(){ Val = FontSchemeValues.Minor };
    
                runProperties2.Append(fontSize2);
                runProperties2.Append(color2);
                runProperties2.Append(runFont2);
                runProperties2.Append(fontFamily2);
                runProperties2.Append(fontScheme2);
                Text text2 = new Text(){ Space = SpaceProcessingModeValues.Preserve };
                text2.Text = " ALLAN";
    
                run2.Append(runProperties2);
                run2.Append(text2);
    
                sharedStringItem1.Append(run1);
                sharedStringItem1.Append(run2);
                return sharedStringItem1;
            }
    

    You can insert that into the SharedStringTable and then set the cell value to be the index in the SharedStringTable where this was inserted.

    There might be some other references that I forgot to include that might be defined in the StylesPart. I recommend creating this example in a blank Excel document and then using the Open XML Productivity Tool to look at the XML. The tool will also supply you with the code I provided you above. It should give you a general direction on where to go next.

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

Sidebar

Related Questions

I have been tasked with designing my web services client code to use the
I very rarely use fortran, however I have been tasked with taking legacy code
I have been tasked with setting up a flat-file SKU database for use on
I was recently tasked with coming up with an offsite backup strategy. We have
I've been tasked with fixing an old VSS database. At this point in time,
I am tasked with writing an authentication component for an open source JAVA app.
I have been tasked with taking an Access 97 application and moving the back-end
I've been tasked with revisiting a database schema we designed and use internally for
I've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET
I have been tasked with migrating an existing mature ASP.NET 2.0 web site to

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.