Beispiel #1
0
 /// <summary>
 /// Set font default for document
 /// </summary>
 public void SetDefaultFontFormat(int FontSize, bool isBold, bool isItalic)
 {
     CurrentSelection.ClearFormatting();
     CurrentSelection.Font.Name = "Calibri";
     CurrentSelection.Font.Size = FontSize;
     if (isBold)
     {
         CurrentSelection.Font.Bold = 1;
     }
     else
     {
         CurrentSelection.Font.Bold = 0;
     }
     if (isItalic)
     {
         CurrentSelection.Font.Italic = 1;
     }
     else
     {
         CurrentSelection.Font.Italic = 0;
     }
     CurrentSelection.Font.Color = (WdColor)Microsoft.VisualBasic.Information.RGB(0, 0, 128);
     CurrentSelection.ParagraphFormat.LineSpacingRule = WdLineSpacing.wdLineSpaceSingle;
     CurrentSelection.ParagraphFormat.LineSpacing     = 10;
     CurrentSelection.ParagraphFormat.SpaceAfter      = 0;
     CurrentSelection.ParagraphFormat.SpaceBefore     = 0;
 }
Beispiel #2
0
 //2012.03.21 Thanh add start
 /// <summary>
 /// Set font default for document
 /// </summary>
 public void SetDefaultFontFormat(int FontSize, bool isBold, WdColor color)
 {
     CurrentSelection.ClearFormatting();
     CurrentSelection.Font.Name = "Calibri";
     CurrentSelection.Font.Size = FontSize;
     if (isBold)
     {
         CurrentSelection.Font.Bold = 1;
     }
     else
     {
         CurrentSelection.Font.Bold = 0;
     }
     CurrentSelection.Font.Color = color;
     CurrentSelection.ParagraphFormat.LineSpacingRule = WdLineSpacing.wdLineSpaceSingle;
     CurrentSelection.ParagraphFormat.LineSpacing     = 10;
     CurrentSelection.ParagraphFormat.SpaceAfter      = 0;
     CurrentSelection.ParagraphFormat.SpaceBefore     = 0;
 }