chetan Allipur

chetan Allipur

  • NA
  • 541
  • 158k

How to apply the Font nane and size for Table Rows in VSTO.

Jul 4 2017 5:59 AM
How to apply the Font nane and size for Table Rows in VSTO word.
 
Here I tried
 
 
Microsoft.Office.Interop.Word.Application app = Globals.ThisAddIn.Application;
ListTemplate template = app.ListGalleries[WdListGalleryType.wdNumberGallery].ListTemplates[1];
Microsoft.Office.Interop.Word.ListLevel level = template.ListLevels[1];
level.NumberFormat = "";
table.Rows[1].Range.Font.Bold = 1;
table.Rows[1].Range.Font.Size = 10;
table.Rows[1].Range.Font.Name = "TimesNewRoman";
table.Rows[1].Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
Range rng = app.Selection.Tables[1].Rows[1].Range;
level.LinkedStyle = "TableHeader10";
rng.ListFormat.ApplyListTemplate(template, false, WdListApplyTo.wdListApplyToSelection);
 
Please send me the code if anyone know