Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Underlining and bolding text

how do I get the text to be underlined and bold? My text gets bold but does not get underlined.
Here is some of my code, which is pretty straight forward uses run properties to bold and underline the given text.

Run run_header = para_main.AppendChild(new Run());
RunProperties runProps = new RunProperties();
Bold bold = new Bold();
Underline ul = new Underline();
runProps.Append(bold);
runProps.Append(ul);
run_header.AppendChild(new RunProperties(runProps));
//run_header.AppendChild(new RunProperties(new Bold(), new Underline()));

string username = form.Username;
string proces_header = form.HeaderTitle;

run_header.AppendChild(new Text(proces_header + " | " + username));
run_header.AppendChild(new Break());
like image 426
AustinT Avatar asked Dec 11 '12 21:12

AustinT


1 Answers

Try to set Underline Val property to Single like this:

new Underline() { Val = DocumentFormat.OpenXml.Wordprocessing.UnderlineValues.Single }
like image 178
RAS Avatar answered Nov 15 '22 22:11

RAS