Esempio n. 1
0
 static void FormatVerticalTable(Wd.Table table, bool Shaded)
 {
     Wd.Styles styles = table.Range.Document.Styles;
     string style = "Table Vertical Blue";
     if (Shaded)
         style = "Table Vertical Shaded Blue";
     if (styles.Exists(style))
         table.set_Style(style);
     if (Shaded)
     {
         if (styles.Exists("Table Heading White"))
             foreach (Wd.Cell cell in table.Columns[1].Cells)
                 cell.Range.SetStyle("Table Heading White");
     }
     else
     {
         if (styles.Exists("Table Heading"))
             foreach (Wd.Cell cell in table.Columns[1].Cells)
                 cell.Range.SetStyle("Table Heading");
     }
     if (styles.Exists("Table Text"))
         for (int i = 2; i <= table.Columns.Count; i++)
             foreach (Wd.Cell cell in table.Columns[i].Cells)
                 cell.Range.SetStyle("Table Text");
 }
Esempio n. 2
0
 static void FormatHorizontalTable(Wd.Table table, bool Shaded)
 {
     Wd.Styles styles = table.Range.Document.Styles;
     string style = "Table Horizontal Blue";
     if (Shaded)
         style = "Table Horizontal Shaded Blue";
     if (styles.Exists(style))
         table.set_Style(style);
     if (Shaded)
     {
         if (styles.Exists("Table Heading White"))
             table.Rows[1].Range.SetStyle("Table Heading White");
     }
     else
     {
         if (styles.Exists("Table Heading"))
             table.Rows[1].Range.SetStyle("Table Heading");
     }
     if (styles.Exists("Table Text"))
         for (int i = 2; i <= table.Rows.Count; i++)
             table.Rows[i].Range.SetStyle("Table Text");
 }