How to change the font size in a table and table border style of the original document.I have code,But did not change after running.
I have a text:Text is 12345 ABC,I want set “Text is” and “ABC” font is Times New Roman,set “12345” font is calibri,How to do it?
I have a text:“1 test title A”
lovecomputer:I have a text:“1 test title A”"2 test title B"I want delete “1” and “2”,What do I need to do?
<span lang=“EN-GB” style=“font-family:“Courier New”;color:green;mso-ansi-language:EN-GB;
mso-no-proof:yes”>// Create an empty document. It contains one empty paragraph.<o:p></o:p>
Document doc = new Document();
// Create a new run of text.
Run run = new Run(doc, "Hello");
// Specify character formatting for the run of text.
Aspose.Words.Font f = run.Font;
f.Name = "Courier New";
f.Size = 36;
f.HighlightColor = Color.Yellow;
// Append the run of text to the end of the first paragraph
// in the body of the first section of the document.
lovecomputer:How to change the font size in a table and table border style of the original document.I have code,But did not change after running.
Document doc = new Document(MyDir + "in.docx");
NodeCollection tables = doc.GetChildNodes(NodeType.Table, true);
foreach (Table table in tables)
// Clear any existing borders from the table.
// Set a green border around the table but not inside.
table.SetBorder(BorderType.Left, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Right, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Top, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Bottom, LineStyle.Single, 1.5, Color.Green, true);
NodeCollection runs = table.GetChildNodes(NodeType.Run, true);
foreach (Run run in runs)
//Change the font of table's cell
run.Font.Bold = true;
run.Font.Size = 10;
run.Font.Name = "Times New Roman";
doc.Save(MyDir + "AsposeOut.docx");
Hope this answers your query. Please let us know if you have any more queries.
Thank you for your answer, there is also the problem:I have text:"2.2Title",I would like to replase "2.2-Title".I have code,But the test was not successful, regular expression test was successful
foreach (Aspose.Words.Paragraph p in doc.Sections.Body.Paragraphs)
p.Runs.Range.Replace(new Regex(@"(?<=^\d+\.\d+)(?=\w)"), "-");