123
362. tbl1.Cell(tbl1.Rows.Count, m +
363. 1).Range.Borders[WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wd
LineStyleSingle;
364. tbl1.Cell(tbl1.Rows.Count, m +
365. 1).Range.Borders[WdBorderType.wdBorderBottom].LineStyle = WdLineStyle
.wdLineStyleSingle; } } } }
366. //сохраняем документ
367. //колонтитулы
368. ap.ActiveDocument.Sections[1].Footers[Microsoft.Office.Interop.Word.WdHe
aderFooterIndex.wd
369. HeaderFooterPrimary].Range.Text = sheetData.Cells[2, 3].value2 == null ? "" :
sheetData.Cells[2,
370. 3].value2; ap.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.
Word.WdHeaderFooterIndex.wd
371. HeaderFooterPrimary].Range.Text = sheetData.Cells[1, 3].value2 == null ? "" :
sheetData.Cells[1,3].value2; ;
372. //получаем список меток с текущей датой и временем
373. DataRow[] dr1 = bDDataSet1.Метки.Select("КодШаблона=" + sh.КодШабло
на
374. + " and (КодВидаМетки=3 or КодВидаМетки=4)");
375. foreach (BDDataSet.МеткиRow m in dr1)
376. { documentData.Bookmarks[m.Наименование].Select();
377. Microsoft.Office.Interop.Word.Selection currentSelection = ap.Selection;
378. if (m.КодВидаМетки == 3)
379. currentSelection.TypeText(DateTime.Now.ToShortDateString());
380. if (m.КодВидаМетки == 4)
381. currentSelection.TypeText(DateTime.Now.ToShortTimeString()); }
382. documentData.SaveAs(d.FullName + @"\" + numberDoc + ".docx");
383. documentData.Close();
384. if(checkBox1.Checked && sheetData.Cells[j,
385. sheetData.UsedRange.Columns.Count - 2].Value2 != null )
386. { string email = sheetData.Cells[j, sheetData.UsedRange.Columns.Count -
387. 2].Value2 == null ? "" : Convert.ToString(sheetData.Cells[j, sheetData.UsedRa
nge.Columns.Count -2].Value2);
388. string tema = sheetData.Cells[j, sheetData.UsedRange.Columns.Count -