コード例 #1
0
 public OfficeExcel()
 {
     excel = new Application {
         Visible = false
     };
     wbs                 = excel.Workbooks;
     wb                  = excel.Workbooks.Open(@"C:\Users\Дмитрий\Documents\Универ\Диплом\PTS\PTS\1.xls");
     CarriageList        = new СarriageСharacteristic();
     CharacteristicsList = new List <Сharacteristics>();
 }
コード例 #2
0
 public WordMainReport(Title infoTitle, СarriageСharacteristic carriage, List <Сharacteristics> characteristics, int count)
 {
     wordapp = new Application()
     {
         Visible = true
     };
     document = wordapp.Documents.Add(Type.Missing, false, WdNewDocumentType.wdNewBlankDocument, true);
     document.SaveAs(@"C:\Users\Дмитрий\Documents\Универ\Диплом\PTS\PTS\" + infoTitle.numberScheme + ".doc", WdSaveFormat.wdFormatDocument);
     document.Content.Font.Size = 12;
     document.Content.Font.Name = "Times New Roman";
     this.infoTitle             = infoTitle;
     this.carriage        = carriage;
     this.characteristics = characteristics;
     this.count           = count;
     document.Application.Selection.PageSetup.LeftMargin            = document.Content.Application.CentimetersToPoints(2);
     document.Application.Selection.PageSetup.RightMargin           = document.Content.Application.CentimetersToPoints(1);
     document.Application.Selection.PageSetup.TopMargin             = document.Content.Application.CentimetersToPoints((float)1.5);
     document.Application.Selection.PageSetup.BottomMargin          = document.Content.Application.CentimetersToPoints((float)3.2);
     document.Application.Selection.ParagraphFormat.LineSpacing     = document.Content.Application.CentimetersToPoints((float)0.5);
     document.Application.Selection.ParagraphFormat.FirstLineIndent = document.Content.Application.CentimetersToPoints((float)1.25);
     document.Application.Selection.ParagraphFormat.SpaceAfter      = 0;
 }