locked
Generating .docx using open xml RRS feed

  • Question

  • how to change the Font color of a table cell?

    the sample code is

     

    Table table = new Table

    ();

     

    TableProperties prop = new TableProperties

    ();

     

    TableBorders bord = new TableBorders

    ();

    bord.TopBorder =

    new TopBorder

    ();

    bord.TopBorder.Val =

    new EnumValue<BorderValues>(BorderValues

    .Nil);

    bord.BottomBorder =

    new BottomBorder

    ();

    bord.BottomBorder.Val =

    new EnumValue<BorderValues>(BorderValues

    .Nil);

    bord.LeftBorder =

    new LeftBorder

    ();

    bord.LeftBorder.Val =

    new EnumValue<BorderValues>(BorderValues

    .Nil);

    bord.RightBorder =

    new RightBorder

    ();

    bord.RightBorder.Val =

    new EnumValue<BorderValues>(BorderValues

    .Nil);

    bord.InsideHorizontalBorder =

    new InsideHorizontalBorder

    ();

    bord.InsideHorizontalBorder.Val =

    new EnumValue<BorderValues>(BorderValues

    .Nil);

    bord.InsideVerticalBorder =

    new InsideVerticalBorder

    ();

    bord.InsideVerticalBorder.Val =

    new EnumValue<BorderValues>(BorderValues

    .Nil);

    prop.Append(bord);

    table.Append(prop);

     

    TableRow

    tr;

     

    TableCell

    tc;

    tr =

    new TableRow

    ();

    tc = new TableCell(new Paragraph(new Run(new Text("MY FIRST OPEN XML DOC"))));

     

    TableCellWidth tcw = new TableCellWidth

    ();

    tcw.Width =

    "1000"

    ;

     

    TableCellProperties tcp = new TableCellProperties

    ();

     

    GridSpan gridspan = new GridSpan

    ();

    gridspan.Val = 11;

    tcp.Append(

    new Shading() {Val =ShadingPatternValues.Clear ,Color = "auto",Fill = "606060"

    });

    tcp.Append(gridspan);

    tcp.Append(tcw);

    tc.Append(tcp);

    tr.Append(tc);

    table.Append(tr);

    documentBody.Append(table);

    with the above code ..how to change the color of text "MY FIRST OPEN XML DOC" .

    

    


    silpa
    Monday, May 30, 2011 9:29 AM

Answers

  • Dear Customer,

           I'm sorry you have a wrong place posted. This forum is used to post questions about the Microsoft Fix it Center automated troubleshooting tool. Could you please post your issue to http://answers.microsoft.com/en-us that you can get the right solution soon, thanks for your understanding.



    Please Mark as Answered If this is helpful Or Un-Mark as Answered if it is not helpful.

    Best Regards,
    Alex

    • Marked as answer by Fafafaalex Tuesday, May 31, 2011 2:23 AM
    Tuesday, May 31, 2011 2:23 AM