private void save() { this.Enabled = false; Directory.CreateDirectory(".\\" + main.companyName + "\\wjgl\\307\\" + a0.Text + ""); string temp = System.IO.Directory.GetCurrentDirectory();// d当前运行路径 // MessageBox.Show(temp); string OrignFile;//word模板路径 OrignFile = "\\baseDB\\商标书式\\5 补证撤三出具证明\\07 撤销成为商品服务通用名称注册商标申请书.dot"; //开始写入数据 string parFilePath = temp + OrignFile;//文件路径 object FilePath = parFilePath; Microsoft.Office.Interop.Word._Application AppliApp = new Microsoft.Office.Interop.Word.Application(); AppliApp.Visible = false; Microsoft.Office.Interop.Word._Document doc = AppliApp.Documents.Add(ref FilePath); object missing = System.Reflection.Missing.Value; object isReadOnly = false; doc.Activate(); //数据写入代码段 object aa = temp + "\\" + main.companyName + "\\wjgl\\307\\" + a0.Text + "\\" + a0.Text + ".docx"; object[] MyBM = new object[12]; //创建一个书签数组 for (int i = 0; i < 12; i++) //给书签数组赋值 { MyBM[i] = "a" + (i + 1).ToString(); } //给对应的书签位置写入数据 doc.Bookmarks.get_Item(ref MyBM[0]).Range.Text = a1.Text; doc.Bookmarks.get_Item(ref MyBM[1]).Range.Text = a2.Text; doc.Bookmarks.get_Item(ref MyBM[2]).Range.Text = a3.Text; doc.Bookmarks.get_Item(ref MyBM[3]).Range.Text = a4.Text; doc.Bookmarks.get_Item(ref MyBM[4]).Range.Text = a5.Text; doc.Bookmarks.get_Item(ref MyBM[5]).Range.Text = a6.Text; doc.Bookmarks.get_Item(ref MyBM[6]).Range.Text = a7.Text; doc.Bookmarks.get_Item(ref MyBM[7]).Range.Text = a8.Text; doc.Bookmarks.get_Item(ref MyBM[8]).Range.Text = a9.Text; doc.Bookmarks.get_Item(ref MyBM[9]).Range.Text = a10.Text; doc.Bookmarks.get_Item(ref MyBM[10]).Range.Text = a11.Text; doc.Bookmarks.get_Item(ref MyBM[11]).Range.Text = a12.Text; doc.SaveAs(ref aa); doc.Close(); this.Enabled = true; }
/// PrinPreview the document /// </summary> /// <param name="fileToPrint"></param> private void PrinPriview(string fileToPrint) { object missing = System.Type.Missing; object objFile = fileToPrint; object readOnly = true; object addToRecentOpen = false; // Create a new Word application Microsoft.Office.Interop.Word._Application wordApplication = new Microsoft.Office.Interop.Word.Application(); try { // Create a new file based on our template Microsoft.Office.Interop.Word._Document wordDocument = wordApplication.Documents.Open(ref objFile, ref missing, ref readOnly, ref addToRecentOpen); wordApplication.Options.SaveNormalPrompt = false; if (wordDocument != null) { // Show print preview wordApplication.Visible = true; wordDocument.PrintPreview(); wordDocument.Activate(); //wordDocument.op while (!_IsPringPriview) { wordDocument.ActiveWindow.View.Magnifier = true; Thread.Sleep(500); } wordDocument.Close(ref missing, ref missing, ref missing); wordDocument = null; } } catch { //I didn't include a default error handler so i'm just throwing the error // throw ex; } finally { // Finally, Close our Word application wordApplication.Quit(ref missing, ref missing, ref missing); wordApplication = null; } }
private void save() { this.Enabled = true; Directory.CreateDirectory(".\\" + main.companyName + "\\wjgl\\563\\" + a0.Text + ""); string temp = System.IO.Directory.GetCurrentDirectory();// d当前运行路径 // MessageBox.Show(temp); string OrignFile;//word模板路径 OrignFile = "\\baseDB\\商标书式\\3 续展变更转让许可质押注销\\6质押\\3商标专用权质权登记期限延期申请书.dot"; //开始写入数据 string parFilePath = temp + OrignFile;//文件路径 object FilePath = parFilePath; Microsoft.Office.Interop.Word._Application AppliApp = new Microsoft.Office.Interop.Word.Application(); AppliApp.Visible = false; Microsoft.Office.Interop.Word._Document doc = AppliApp.Documents.Add(ref FilePath); object missing = System.Reflection.Missing.Value; object isReadOnly = false; doc.Activate(); //数据写入代码段 object aa = temp + "\\" + main.companyName + "\\wjgl\\563\\" + a0.Text + "\\" + a0.Text + ".docx"; object[] MyBM = new object[34]; //创建一个书签数组 for (int i = 0; i < 34; i++) //给书签数组赋值 { MyBM[i] = "a" + (i + 1).ToString(); } //给对应的书签位置写入数据 doc.Bookmarks.get_Item(ref MyBM[0]).Range.Text = a1.Text; doc.Bookmarks.get_Item(ref MyBM[1]).Range.Text = a2.Text; doc.Bookmarks.get_Item(ref MyBM[2]).Range.Text = a3.Text; doc.Bookmarks.get_Item(ref MyBM[3]).Range.Text = a4.Text; doc.Bookmarks.get_Item(ref MyBM[4]).Range.Text = a5.Text; doc.Bookmarks.get_Item(ref MyBM[5]).Range.Text = a6.Text; doc.Bookmarks.get_Item(ref MyBM[6]).Range.Text = a7.Text; doc.Bookmarks.get_Item(ref MyBM[7]).Range.Text = a8.Text; doc.Bookmarks.get_Item(ref MyBM[8]).Range.Text = a9.Text; doc.Bookmarks.get_Item(ref MyBM[9]).Range.Text = a10.Text; doc.Bookmarks.get_Item(ref MyBM[10]).Range.Text = a11.Text; doc.Bookmarks.get_Item(ref MyBM[11]).Range.Text = a12.Text; doc.Bookmarks.get_Item(ref MyBM[12]).Range.Text = a13.Text; doc.Bookmarks.get_Item(ref MyBM[13]).Range.Text = a14.Text; doc.Bookmarks.get_Item(ref MyBM[14]).Range.Text = a15.Text; doc.Bookmarks.get_Item(ref MyBM[15]).Range.Text = a16.Text; doc.Bookmarks.get_Item(ref MyBM[16]).Range.Text = a17.Text; doc.Bookmarks.get_Item(ref MyBM[17]).Range.Text = a18.Text; doc.Bookmarks.get_Item(ref MyBM[18]).Range.Text = a19.Text; doc.Bookmarks.get_Item(ref MyBM[19]).Range.Text = a20.Text; doc.Bookmarks.get_Item(ref MyBM[20]).Range.Text = a21.Text; doc.Bookmarks.get_Item(ref MyBM[21]).Range.Text = a22.Text; doc.Bookmarks.get_Item(ref MyBM[22]).Range.Text = a23.Text; doc.Bookmarks.get_Item(ref MyBM[23]).Range.Text = a24.Text; doc.Bookmarks.get_Item(ref MyBM[24]).Range.Text = a25.Text; doc.Bookmarks.get_Item(ref MyBM[25]).Range.Text = a26.Text; doc.Bookmarks.get_Item(ref MyBM[26]).Range.Text = a27.Text; doc.Bookmarks.get_Item(ref MyBM[27]).Range.Text = a28.Text; doc.Bookmarks.get_Item(ref MyBM[28]).Range.Text = a29.Text; doc.Bookmarks.get_Item(ref MyBM[29]).Range.Text = a30.Text; doc.Bookmarks.get_Item(ref MyBM[30]).Range.Text = a31.Text; doc.Bookmarks.get_Item(ref MyBM[31]).Range.Text = a32.Text; doc.Bookmarks.get_Item(ref MyBM[32]).Range.Text = a33.Text; doc.Bookmarks.get_Item(ref MyBM[33]).Range.Text = a34.Text; doc.SaveAs(ref aa); doc.Close(); this.Enabled = true; }
public static void ExportWordByMicrosoftOfficeInteropWord(string databaseName, List <TableDto> tables) { string docTitle = "数据库名:" + databaseName; object template = System.Reflection.Missing.Value; object oEndOfDoc = @"\endofdoc"; // \endofdoc是预定义的bookmark // TODO 依赖冲突,所以用了全类名 Microsoft.Office.Interop.Word._Application application = new Microsoft.Office.Interop.Word.Application(); application.Visible = false; Microsoft.Office.Interop.Word._Document document = application.Documents.Add(ref template, ref template, ref template, ref template); application.ActiveWindow.View.Type = Microsoft.Office.Interop.Word.WdViewType.wdOutlineView; application.ActiveWindow.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekPrimaryHeader; application.ActiveWindow.ActivePane.Selection.InsertAfter("DBCHM https://gitee.com/lztkdr/DBCHM"); application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphRight; application.ActiveWindow.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekMainDocument; Microsoft.Office.Interop.Word.Paragraph paragraph = document.Content.Paragraphs.Add(ref template); paragraph.Range.Text = docTitle; paragraph.Range.Font.Bold = 1; paragraph.Range.Font.Name = "宋体"; paragraph.Range.Font.Size = 12f; paragraph.Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter; paragraph.Format.SpaceAfter = 5f; paragraph.OutlineLevel = Microsoft.Office.Interop.Word.WdOutlineLevel.wdOutlineLevel1; paragraph.Range.InsertParagraphAfter(); // TODO 遍历数据库表集合 foreach (var table in tables) { string docTableName = table.TableName + " " + (!string.IsNullOrWhiteSpace(table.Comment) ? table.Comment : ""); // TODO 一级标题 object oRng = document.Bookmarks[oEndOfDoc].Range; Microsoft.Office.Interop.Word.Paragraph paragraph2 = document.Content.Paragraphs.Add(ref oRng); paragraph2.Range.Text = docTableName; paragraph2.Range.Font.Bold = 1; paragraph2.Range.Font.Name = "宋体"; paragraph2.Range.Font.Size = 10f; paragraph2.OutlineLevel = Microsoft.Office.Interop.Word.WdOutlineLevel.wdOutlineLevel2; paragraph2.Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft; paragraph2.Format.SpaceBefore = 15f; paragraph2.Format.SpaceAfter = 5f; paragraph2.Range.InsertParagraphAfter(); // TODO 遍历数据库表字段集合 // TODO 创建表格 Microsoft.Office.Interop.Word.Range range = document.Bookmarks[oEndOfDoc].Range; Microsoft.Office.Interop.Word.Table table2 = document.Tables.Add(range, table.Columns.Count + 1, 10, ref template, ref template); table2.Range.Font.Name = "宋体"; table2.Range.Font.Bold = 0; table2.Range.Font.Size = 9f; table2.Borders.Enable = 1; table2.Rows.Height = 10f; table2.AllowAutoFit = true; table2.Cell(1, 1).Range.Text = "序号"; table2.Cell(1, 2).Range.Text = "列名"; table2.Cell(1, 3).Range.Text = "数据类型"; table2.Cell(1, 4).Range.Text = "长度"; table2.Cell(1, 5).Range.Text = "小数位"; table2.Cell(1, 6).Range.Text = "主键"; table2.Cell(1, 7).Range.Text = "自增"; table2.Cell(1, 8).Range.Text = "允许空"; table2.Cell(1, 9).Range.Text = "默认值"; table2.Cell(1, 10).Range.Text = "列说明"; // TODO 分别设置word文档中表格的列宽 int j = 0; foreach (var column in table.Columns) { table2.Cell(j + 2, 1).Range.Text = column.ColumnOrder; table2.Cell(j + 2, 2).Range.Text = column.ColumnName; table2.Cell(j + 2, 3).Range.Text = column.ColumnTypeName; table2.Cell(j + 2, 4).Range.Text = column.Length; table2.Cell(j + 2, 5).Range.Text = column.Scale; table2.Cell(j + 2, 6).Range.Text = column.IsPK; table2.Cell(j + 2, 7).Range.Text = column.IsIdentity; table2.Cell(j + 2, 8).Range.Text = column.CanNull; table2.Cell(j + 2, 9).Range.Text = column.DefaultVal; table2.Cell(j + 2, 10).Range.Text = column.Comment; j++; } } application.Visible = true; document.Activate(); }
private void save() { this.Enabled = true; Directory.CreateDirectory(".\\" + main.companyName + "\\wjgl\\7\\" + a0.Text + ""); string temp = System.IO.Directory.GetCurrentDirectory();// d当前运行路径 // MessageBox.Show(temp); string OrignFile;//word模板路径 OrignFile = "\\baseDB\\商标书式\\7 评审复审\\8商标评审代理委托书\\商标评审代理委托书(样式).dot"; //开始写入数据 string parFilePath = temp + OrignFile;//文件路径 object FilePath = parFilePath; Microsoft.Office.Interop.Word._Application AppliApp = new Microsoft.Office.Interop.Word.Application(); AppliApp.Visible = false; Microsoft.Office.Interop.Word._Document doc = AppliApp.Documents.Add(ref FilePath); object missing = System.Reflection.Missing.Value; object isReadOnly = false; doc.Activate(); //数据写入代码段 object aa = temp + "\\" + main.companyName + "\\wjgl\\7\\" + a0.Text + "\\" + a0.Text + ".docx"; object[] MyBM = new object[21]; //创建一个书签数组 for (int i = 0; i < 12; i++) //给书签数组赋值 { MyBM[i] = "a" + (i + 1).ToString(); } MyBM[12] = "a13_1"; MyBM[13] = "a13_2"; MyBM[14] = "a13_3"; MyBM[15] = "a13_4"; MyBM[16] = "a13_5"; MyBM[17] = "a14"; MyBM[18] = "a15_1"; MyBM[19] = "a15_2"; MyBM[20] = "a15_3"; // MyBM[21] = "a16"; /* 驳回商标注册申请复审案 * 商标不予注册复审案 * 撤销注册商标复审案 * 注册商标无效宣告案 * 注册商标无效宣告复审案*/ //给对应的书签位置写入数据 doc.Bookmarks.get_Item(ref MyBM[0]).Range.Text = a1.Text; doc.Bookmarks.get_Item(ref MyBM[1]).Range.Text = a2.Text; doc.Bookmarks.get_Item(ref MyBM[2]).Range.Text = a3.Text; doc.Bookmarks.get_Item(ref MyBM[3]).Range.Text = a4.Text; doc.Bookmarks.get_Item(ref MyBM[4]).Range.Text = a5.Text; doc.Bookmarks.get_Item(ref MyBM[5]).Range.Text = a6.Text; doc.Bookmarks.get_Item(ref MyBM[6]).Range.Text = a7.Text; doc.Bookmarks.get_Item(ref MyBM[7]).Range.Text = a8.Text; doc.Bookmarks.get_Item(ref MyBM[8]).Range.Text = a9.Text; doc.Bookmarks.get_Item(ref MyBM[9]).Range.Text = a10.Text; doc.Bookmarks.get_Item(ref MyBM[10]).Range.Text = a11.Text; doc.Bookmarks.get_Item(ref MyBM[11]).Range.Text = a12.Text; if (a13.Text == "驳回商标注册申请复审案") { doc.Bookmarks.get_Item(ref MyBM[12]).Range.Text = "✔"; } if (a13.Text == "商标不予注册复审案") { doc.Bookmarks.get_Item(ref MyBM[13]).Range.Text = "✔"; } if (a13.Text == "撤销注册商标复审案") { doc.Bookmarks.get_Item(ref MyBM[14]).Range.Text = "✔"; } if (a13.Text == "注册商标无效宣告案") { doc.Bookmarks.get_Item(ref MyBM[15]).Range.Text = "✔"; } if (a13.Text == "注册商标无效宣告复审案") { doc.Bookmarks.get_Item(ref MyBM[16]).Range.Text = "✔"; } doc.Bookmarks.get_Item(ref MyBM[17]).Range.Text = a14.Text; doc.Bookmarks.get_Item(ref MyBM[18]).Range.Text = a15_1.Text; doc.Bookmarks.get_Item(ref MyBM[19]).Range.Text = a15_2.Text; doc.Bookmarks.get_Item(ref MyBM[20]).Range.Text = a15_3.Text; // doc.Bookmarks.get_Item(ref MyBM[21]).Range.Text = a16.Text; doc.SaveAs(ref aa); doc.Close(); this.Enabled = true; }
private void save() { this.Enabled = false; Directory.CreateDirectory(".\\" + main.companyName + "\\wjgl\\522\\" + a0.Text + ""); string temp = System.IO.Directory.GetCurrentDirectory();// d当前运行路径 // MessageBox.Show(temp); string OrignFile;//word模板路径 OrignFile = "\\baseDB\\商标书式\\3 续展变更转让许可质押注销\\2变更\\2撤回变更商标申请人注册人名义地址变更集体商标证明商标管理规则集体成员名单申请书.dot"; //开始写入数据 string parFilePath = temp + OrignFile;//文件路径 object FilePath = parFilePath; Microsoft.Office.Interop.Word._Application AppliApp = new Microsoft.Office.Interop.Word.Application(); AppliApp.Visible = false; Microsoft.Office.Interop.Word._Document doc = AppliApp.Documents.Add(ref FilePath); object missing = System.Reflection.Missing.Value; object isReadOnly = false; doc.Activate(); //数据写入代码段 object aa = temp + "\\" + main.companyName + "\\wjgl\\522\\" + a0.Text + "\\" + a0.Text + ".docx"; object[] MyBM = new object[34]; //创建一个书签数组 for (int i = 0; i < 9; i++) //给书签数组赋值 { MyBM[i] = "a" + (i + 1).ToString(); } MyBM[9] = "a10_1"; MyBM[10] = "a10_2"; MyBM[11] = "a11"; MyBM[12] = "a12_1"; MyBM[13] = "a12_2"; for (int i = 14; i < 23; i++)//给书签数组赋值 { MyBM[i] = "a" + (i - 1).ToString(); } //给对应的书签位置写入数据 doc.Bookmarks.get_Item(ref MyBM[0]).Range.Text = a1.Text; doc.Bookmarks.get_Item(ref MyBM[1]).Range.Text = a2.Text; doc.Bookmarks.get_Item(ref MyBM[2]).Range.Text = a3.Text; doc.Bookmarks.get_Item(ref MyBM[3]).Range.Text = a4.Text; doc.Bookmarks.get_Item(ref MyBM[4]).Range.Text = a5.Text; doc.Bookmarks.get_Item(ref MyBM[5]).Range.Text = a6.Text; doc.Bookmarks.get_Item(ref MyBM[6]).Range.Text = a7.Text; doc.Bookmarks.get_Item(ref MyBM[7]).Range.Text = a8.Text; doc.Bookmarks.get_Item(ref MyBM[8]).Range.Text = a9.Text; if (a10.Text == "是") { doc.Bookmarks.get_Item(ref MyBM[9]).Range.Text = "✔"; } if (a10.Text == "否") { doc.Bookmarks.get_Item(ref MyBM[10]).Range.Text = "✔"; } doc.Bookmarks.get_Item(ref MyBM[11]).Range.Text = a11.Text; if (a12_1.CheckState == CheckState.Checked) { doc.Bookmarks.get_Item(ref MyBM[12]).Range.Text = "✔"; } if (a12_2.CheckState == CheckState.Checked) { doc.Bookmarks.get_Item(ref MyBM[13]).Range.Text = "✔"; } doc.Bookmarks.get_Item(ref MyBM[14]).Range.Text = a14.Text; doc.Bookmarks.get_Item(ref MyBM[16]).Range.Text = a15.Text; doc.Bookmarks.get_Item(ref MyBM[17]).Range.Text = a16.Text; doc.Bookmarks.get_Item(ref MyBM[18]).Range.Text = a17.Text; doc.Bookmarks.get_Item(ref MyBM[19]).Range.Text = a18.Text; doc.Bookmarks.get_Item(ref MyBM[20]).Range.Text = a19.Text; doc.Bookmarks.get_Item(ref MyBM[21]).Range.Text = a20.Text; doc.Bookmarks.get_Item(ref MyBM[22]).Range.Text = a21.Text; doc.SaveAs(ref aa); doc.Close(); this.Enabled = true; }
private void BtnExportTP_Click(object sender, EventArgs e) { mf.wsm.Visible = true; mf.wsm.Update(); Microsoft.Office.Interop.Word._Application oWord = null; try { oWord = new Microsoft.Office.Interop.Word.Application(); } catch { mf.wsm.Visible = false; MessageBox.Show("На ПК не установлен пакет Microsoft Office Word 2007 или позднее. Экспорт невозможен.", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Microsoft.Office.Interop.Word._Document oDoc = null; try { oDoc = oWord.Documents.Add(Environment.CurrentDirectory + "\\templateTP.docx"); } catch { mf.wsm.Visible = false; MessageBox.Show("Отсутствует файл шаблона тех. проекта \"templateTP.docx\". Экспорт невозможен.", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Microsoft.Office.Interop.Word.Table wordTable; Microsoft.Office.Interop.Word.Range bm; int row = 0; using (KPSZIContext db = new KPSZIContext()) { #region Заполнение СФХ var listOfSFHs = db.SFHs.ToList().Intersect(IS.listOfSFHs).ToList(); var listOfSFHTypes = new List <SFHType>(); foreach (SFH sfh in listOfSFHs) { listOfSFHTypes.Add(sfh.SFHType); } listOfSFHTypes = listOfSFHTypes.Distinct().OrderBy(st => st.SFHTypeId).ToList(); bm = oDoc.Bookmarks["SFH"].Range; bm.Tables.Add(bm, listOfSFHTypes.Count, 2, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); List <SFHType> lst = new List <SFHType>(); row = 1; foreach (SFHType sfhtype in listOfSFHTypes) { if (IS.listOfSFHs.Where(s => s.SFHType.Name == sfhtype.Name).ToList().Count == 0) { continue; } wordTable.Cell(row, 1).Range.Text = sfhtype.Name; string sfhs = ""; foreach (SFH sfh in IS.listOfSFHs.Where(sfh => sfh.SFHType.Name == sfhtype.Name).ToList()) { sfhs += sfh.Name + ", "; } sfhs = sfhs.TrimEnd(' ').TrimEnd(','); wordTable.Cell(row, 2).Range.Text = sfhs; row++; } #endregion #region Базовый набор мер bm = oDoc.Bookmarks["Basic_Set"].Range; bm.Tables.Add(bm, mf.dgvBasicMeas.Rows.Count + 1, 2, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Columns.PreferredWidthType = Microsoft.Office.Interop.Word.WdPreferredWidthType.wdPreferredWidthPercent; wordTable.Columns[1].PreferredWidth = 6f; wordTable.Columns[2].PreferredWidth = 94f; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Rows[1].Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowCenter; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); wordTable.Cell(1, 1).Range.Text = "№ п/п"; wordTable.Cell(1, 2).Range.Text = "Наименование базовой меры"; row = 2; foreach (DataGridViewRow dgvrow in mf.dgvBasicMeas.Rows) { wordTable.Cell(row, 1).Range.Text = (row - 1).ToString(); wordTable.Cell(row++, 2).Range.Text = dgvrow.Cells[1].Value.ToString(); } #endregion #region Адаптация базового набора мер bm = oDoc.Bookmarks["Adaptive_Set"].Range; bm.Tables.Add(bm, StageMeasures.ListOfExcludedMeasures.Count + 1, 2, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Columns.PreferredWidthType = Microsoft.Office.Interop.Word.WdPreferredWidthType.wdPreferredWidthPercent; wordTable.Columns[1].PreferredWidth = 6f; wordTable.Columns[2].PreferredWidth = 94f; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Rows[1].Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowCenter; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); wordTable.Cell(1, 1).Range.Text = "№ п/п"; wordTable.Cell(1, 2).Range.Text = "Наименование меры"; row = 2; foreach (GISMeasure gm in StageMeasures.ListOfExcludedMeasures) { wordTable.Cell(row, 1).Range.Text = (row - 1).ToString(); wordTable.Cell(row++, 2).Range.Text = gm.ToString(); } #endregion #region Уточненение адаптированного базового набора мер //Вывод УБИ-меры bm = oDoc.Bookmarks["Thr_Meas"].Range; bm.Tables.Add(bm, mf.dgvThrMeas.Rows.Count + 1, 3, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Columns.PreferredWidthType = Microsoft.Office.Interop.Word.WdPreferredWidthType.wdPreferredWidthPercent; wordTable.Columns[1].PreferredWidth = 6f; wordTable.Columns[2].PreferredWidth = 19f; wordTable.Columns[3].PreferredWidth = 75f; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Rows[1].Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowCenter; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); wordTable.Cell(1, 1).Range.Text = "№ п/п"; wordTable.Cell(1, 2).Range.Text = "Наименование угрозы"; wordTable.Cell(1, 3).Range.Text = "Меры по нейтрализации УБИ"; row = 2; foreach (DataGridViewRow dgvrow in mf.dgvThrMeas.Rows) { wordTable.Cell(row, 1).Range.Text = (row - 1).ToString(); wordTable.Cell(row, 2).Range.Text = dgvrow.Cells[1].Value.ToString(); wordTable.Cell(row++, 3).Range.Text = dgvrow.Cells[2].Value.ToString(); } //Вывод добавляемых мер bm = oDoc.Bookmarks["Add_Meas"].Range; bm.Tables.Add(bm, StageMeasures.ListOfAddedMeasures.Count + 1, 2, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Columns.PreferredWidthType = Microsoft.Office.Interop.Word.WdPreferredWidthType.wdPreferredWidthPercent; wordTable.Columns[1].PreferredWidth = 6f; wordTable.Columns[2].PreferredWidth = 94f; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Rows[1].Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowCenter; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); wordTable.Cell(1, 1).Range.Text = "№ п/п"; wordTable.Cell(1, 2).Range.Text = "Наименование добавляемой меры"; row = 2; foreach (GISMeasure gm in StageMeasures.ListOfAddedMeasures) { wordTable.Cell(row, 1).Range.Text = (row - 1).ToString(); wordTable.Cell(row++, 2).Range.Text = gm.ToString(); } #endregion #region Итоговый перечень мер bm = oDoc.Bookmarks["Final_Set"].Range; bm.Tables.Add(bm, mf.dgvConcreteMeas.Rows.Count + 1, 2, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Columns.PreferredWidthType = Microsoft.Office.Interop.Word.WdPreferredWidthType.wdPreferredWidthPercent; wordTable.Columns[1].PreferredWidth = 6f; wordTable.Columns[2].PreferredWidth = 94f; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Rows[1].Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowCenter; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); wordTable.Cell(1, 1).Range.Text = "№ п/п"; wordTable.Cell(1, 2).Range.Text = "Наименование меры"; row = 2; foreach (DataGridViewRow dgvrow in mf.dgvConcreteMeas.Rows) { wordTable.Cell(row, 1).Range.Text = (row - 1).ToString(); wordTable.Cell(row++, 2).Range.Text = dgvrow.Cells[1].Value.ToString(); } #endregion #region Перечень предлагаемых СЗИ bm = oDoc.Bookmarks["SZIs_Set"].Range; bm.Tables.Add(bm, mf.dgvSZIs.Rows.Count + 1, 5, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Columns.PreferredWidthType = Microsoft.Office.Interop.Word.WdPreferredWidthType.wdPreferredWidthPercent; wordTable.Columns[1].PreferredWidth = 4.5f; wordTable.Columns[2].PreferredWidth = 36.3f; wordTable.Columns[3].PreferredWidth = 19.6f; wordTable.Columns[4].PreferredWidth = 25.7f; wordTable.Columns[5].PreferredWidth = 13.6f; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Rows[1].Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowCenter; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); wordTable.Cell(1, 1).Range.Text = "№"; wordTable.Cell(1, 2).Range.Text = "Наименование СЗИ"; wordTable.Cell(1, 3).Range.Text = "Вид"; wordTable.Cell(1, 4).Range.Text = "Сертификат"; wordTable.Cell(1, 5).Range.Text = "Уровень контроля отсутствия НДВ"; row = 2; foreach (DataGridViewRow dgvrow in mf.dgvSZIs.Rows) { wordTable.Cell(row, 1).Range.Text = (row - 1).ToString(); wordTable.Cell(row, 2).Range.Text = dgvrow.Cells[1].Value.ToString(); wordTable.Cell(row, 3).Range.Text = dgvrow.Cells[2].Value.ToString(); wordTable.Cell(row, 4).Range.Text = dgvrow.Cells[3].Value.ToString(); wordTable.Cell(row++, 5).Range.Text = dgvrow.Cells[4].Value.ToString(); } #endregion #region Мера-СЗИ bm = oDoc.Bookmarks["Meas_SZIs"].Range; bm.Tables.Add(bm, mf.dgvMeasSZIs.Rows.Count + 1, 3, Type.Missing, Type.Missing); wordTable = bm.Tables[1]; wordTable.Borders.InsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Borders.OutsideLineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordTable.Columns.PreferredWidthType = Microsoft.Office.Interop.Word.WdPreferredWidthType.wdPreferredWidthPercent; wordTable.Columns[1].PreferredWidth = 6f; wordTable.Columns[2].PreferredWidth = 60f; wordTable.Columns[3].PreferredWidth = 34f; wordTable.Rows.Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowLeft; wordTable.Rows[1].Alignment = Microsoft.Office.Interop.Word.WdRowAlignment.wdAlignRowCenter; wordTable.Range.Cells.VerticalAlignment = Microsoft.Office.Interop.Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; wordTable.Range.Select(); wordTable.Cell(1, 1).Range.Text = @"№ п\п"; wordTable.Cell(1, 2).Range.Text = "Название меры"; wordTable.Cell(1, 3).Range.Text = "Перечень СЗИ"; row = 2; foreach (DataGridViewRow dgvrow in mf.dgvMeasSZIs.Rows) { wordTable.Cell(row, 1).Range.Text = (row - 1).ToString(); wordTable.Cell(row, 2).Range.Text = dgvrow.Cells[1].Value.ToString(); wordTable.Cell(row++, 3).Range.Text = dgvrow.Cells[2].Value.ToString(); } #endregion #region Замена слов mf.FindAndReplace(oWord, "{ИМЯ_ИС}", IS.ISName); mf.FindAndReplace(oWord, "{КЗ}", IS.GISClass); #endregion oDoc.Activate(); oWord.Visible = true; } mf.wsm.Visible = false; }
private void save() { this.Enabled = false; Directory.CreateDirectory(".\\" + main.companyName + "\\wjgl\\101\\" + a0.Text + ""); string temp = System.IO.Directory.GetCurrentDirectory();// d当前运行路径 // MessageBox.Show(temp); string OrignFile; OrignFile = "\\baseDB\\商标书式\\1 注册申请\\01 商标注册申请书.dot"; //开始写入数据 int a13_1_a = 0, a13_2_a = 0, a13_3_a = 0, a13_4_a = 0, a13_5_a = 0, a13_6_a = 0; if (a13_1.CheckState == CheckState.Checked) { a13_1_a = 1; } if (a13_2.CheckState == CheckState.Checked) { a13_2_a = 1; } if (a13_3.CheckState == CheckState.Checked) { a13_3_a = 1; } if (a13_4.CheckState == CheckState.Checked) { a13_4_a = 1; } if (a13_5.CheckState == CheckState.Checked) { a13_5_a = 1; } if (a13_6.CheckState == CheckState.Checked) { a13_6_a = 1; } string parFilePath = temp + OrignFile;//文件路径 object FilePath = parFilePath; Microsoft.Office.Interop.Word._Application AppliApp = new Microsoft.Office.Interop.Word.Application(); AppliApp.Visible = false; Microsoft.Office.Interop.Word._Document doc = AppliApp.Documents.Add(ref FilePath); object missing = System.Reflection.Missing.Value; object isReadOnly = false; doc.Activate(); //数据写入代码段 object aa = temp + "\\" + main.companyName + "\\wjgl\\101\\" + a0.Text + "\\" + a0.Text + ".docx"; //命名更改 object[] MyBM = new object[30]; //创建一个书签数组 for (int i = 0; i < 12; i++) //给书签数组赋值 { MyBM[i] = "a" + (i + 1).ToString(); } MyBM[12] = "a13_1"; MyBM[13] = "a13_2"; MyBM[14] = "a13_3"; MyBM[15] = "a13_4"; MyBM[16] = "a13_5"; MyBM[17] = "a13_6"; MyBM[18] = "a14_1"; MyBM[19] = "a14_2"; MyBM[20] = "a14_3"; MyBM[21] = "a15"; MyBM[22] = "a16"; MyBM[23] = "a17"; MyBM[24] = "a18"; MyBM[25] = "a19"; MyBM[26] = "a20"; MyBM[27] = "a21"; MyBM[28] = "a22"; MyBM[29] = "a25"; //给对应的书签位置写入数据 doc.Bookmarks.get_Item(ref MyBM[0]).Range.Text = a1.Text; doc.Bookmarks.get_Item(ref MyBM[1]).Range.Text = a2.Text; doc.Bookmarks.get_Item(ref MyBM[2]).Range.Text = a3.Text; doc.Bookmarks.get_Item(ref MyBM[3]).Range.Text = a4.Text; doc.Bookmarks.get_Item(ref MyBM[4]).Range.Text = a5.Text; doc.Bookmarks.get_Item(ref MyBM[5]).Range.Text = a6.Text; doc.Bookmarks.get_Item(ref MyBM[6]).Range.Text = a7.Text; doc.Bookmarks.get_Item(ref MyBM[7]).Range.Text = a8.Text; doc.Bookmarks.get_Item(ref MyBM[8]).Range.Text = a9.Text; doc.Bookmarks.get_Item(ref MyBM[9]).Range.Text = a10.Text; doc.Bookmarks.get_Item(ref MyBM[10]).Range.Text = a11.Text; doc.Bookmarks.get_Item(ref MyBM[11]).Range.Text = a12.Text; string xx; if (a13_1_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[12]).Range.Text = xx; if (a13_2_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[13]).Range.Text = xx; if (a13_3_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[14]).Range.Text = xx; if (a13_4_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[15]).Range.Text = xx; if (a13_5_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[16]).Range.Text = xx; if (a13_6_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[17]).Range.Text = xx; switch (a14.Text) { case "基于第一次申请的优先权": doc.Bookmarks.get_Item(ref MyBM[18]).Range.Text = "✔"; break; case "基于展会的优先权": doc.Bookmarks.get_Item(ref MyBM[19]).Range.Text = "✔"; break; case "优先权证明文件后补": doc.Bookmarks.get_Item(ref MyBM[20]).Range.Text = "✔"; break; default: break; } doc.Bookmarks.get_Item(ref MyBM[21]).Range.Text = a15.Text; doc.Bookmarks.get_Item(ref MyBM[22]).Range.Text = a16.Text; doc.Bookmarks.get_Item(ref MyBM[23]).Range.Text = a17.Text; doc.Bookmarks.get_Item(ref MyBM[24]).Range.Text = a18.Text; doc.Bookmarks.get_Item(ref MyBM[25]).Range.Text = a19.Text; doc.Bookmarks.get_Item(ref MyBM[26]).Range.Text = a20.Text; doc.Bookmarks.get_Item(ref MyBM[27]).Range.Text = a21.Text; doc.Bookmarks.get_Item(ref MyBM[28]).Range.Text = a22.Text; doc.Bookmarks.get_Item(ref MyBM[29]).Range.Text = a25.Text; doc.SaveAs(ref aa); doc.Close(); this.Enabled = true; }
private void save() { this.Enabled = false; // thw new NotImplementedException(); int a8_1_a = 0, a8_2_a = 0, a8_3_a = 0; if (a8_1.CheckState == CheckState.Checked) { a8_1_a = 1; } if (a8_2.CheckState == CheckState.Checked) { a8_2_a = 1; } if (a8_3.CheckState == CheckState.Checked) { a8_3_a = 1; } Directory.CreateDirectory(".\\" + main.companyName + "\\wjgl\\301\\" + a0.Text + ""); string temp = System.IO.Directory.GetCurrentDirectory();// d当前运行路径 // MessageBox.Show(temp); string OrignFile; OrignFile = "\\baseDB\\商标书式\\5 补证撤三出具证明\\01 补发变更转让续展证明申请书.dot"; //开始写入数据 string parFilePath = temp + OrignFile;//文件路径 object FilePath = parFilePath; Microsoft.Office.Interop.Word._Application AppliApp = new Microsoft.Office.Interop.Word.Application(); AppliApp.Visible = false; Microsoft.Office.Interop.Word._Document doc = AppliApp.Documents.Add(ref FilePath); object missing = System.Reflection.Missing.Value; object isReadOnly = false; doc.Activate(); //数据写入代码段 object aa = temp + ".\\" + main.companyName + "\\wjgl\\301\\" + a0.Text + "\\" + a0.Text + ".docx"; //命名更改 object[] MyBM = new object[15]; //创建一个书签数组 for (int i = 0; i < 7; i++) //给书签数组赋值 { MyBM[i] = "a" + (i + 1).ToString(); } MyBM[7] = "a8_1"; MyBM[8] = "a8_2"; MyBM[9] = "a8_3"; MyBM[10] = "a9"; MyBM[11] = "a10"; MyBM[12] = "a11"; MyBM[13] = "a12"; MyBM[14] = "a13"; //给对应的书签位置写入数据 doc.Bookmarks.get_Item(ref MyBM[0]).Range.Text = a1.Text; doc.Bookmarks.get_Item(ref MyBM[1]).Range.Text = a2.Text; doc.Bookmarks.get_Item(ref MyBM[2]).Range.Text = a3.Text; doc.Bookmarks.get_Item(ref MyBM[3]).Range.Text = a4.Text; doc.Bookmarks.get_Item(ref MyBM[4]).Range.Text = a5.Text; doc.Bookmarks.get_Item(ref MyBM[5]).Range.Text = a6.Text; doc.Bookmarks.get_Item(ref MyBM[6]).Range.Text = a7.Text; string xx; if (a8_1_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[7]).Range.Text = xx; if (a8_2_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[8]).Range.Text = xx; if (a8_3_a == 1) { xx = "✔"; } else { xx = " "; } doc.Bookmarks.get_Item(ref MyBM[9]).Range.Text = xx; doc.Bookmarks.get_Item(ref MyBM[10]).Range.Text = a9.Text; doc.Bookmarks.get_Item(ref MyBM[11]).Range.Text = a10.Text; doc.Bookmarks.get_Item(ref MyBM[12]).Range.Text = a11.Text; doc.Bookmarks.get_Item(ref MyBM[13]).Range.Text = a12.Text; doc.Bookmarks.get_Item(ref MyBM[14]).Range.Text = a13.Text; doc.SaveAs(ref aa); doc.Close(); this.Enabled = true; }
private void save() { this.Enabled = true; Directory.CreateDirectory(".\\" + main.companyName + "\\wjgl\\6\\" + a0.Text + ""); string temp = System.IO.Directory.GetCurrentDirectory();// d当前运行路径 // MessageBox.Show(temp); string OrignFile;//word模板路径 OrignFile = "\\baseDB\\商标书式\\6 商标代理委托书\\商标代理委托书(示范文本).dot"; //开始写入数据 string parFilePath = temp + OrignFile;//文件路径 object FilePath = parFilePath; Microsoft.Office.Interop.Word._Application AppliApp = new Microsoft.Office.Interop.Word.Application(); AppliApp.Visible = false; Microsoft.Office.Interop.Word._Document doc = AppliApp.Documents.Add(ref FilePath); object missing = System.Reflection.Missing.Value; object isReadOnly = false; doc.Activate(); //数据写入代码段 object aa = temp + "\\" + main.companyName + "\\wjgl\\6\\" + a0.Text + "\\" + a0.Text + ".docx"; object[] MyBM = new object[57]; //创建一个书签数组 for (int i = 0; i < 4; i++) //给书签数组赋值 { MyBM[i] = "a" + (i + 1).ToString(); } for (int i = 4; i < 42; i++) { MyBM[i] = "a5_" + (i - 3).ToString(); } for (int i = 42; i < 55; i++) { MyBM[i] = "a" + (i - 36).ToString(); } MyBM[46] = "a10_1"; MyBM[55] = "a10_2"; MyBM[56] = "a10_3"; //给对应的书签位置写入数据 doc.Bookmarks.get_Item(ref MyBM[0]).Range.Text = a1.Text; doc.Bookmarks.get_Item(ref MyBM[1]).Range.Text = a2.Text; doc.Bookmarks.get_Item(ref MyBM[2]).Range.Text = a3.Text; doc.Bookmarks.get_Item(ref MyBM[3]).Range.Text = a4.Text; if (a5.Text == "商标注册申请") { doc.Bookmarks.get_Item(ref MyBM[4]).Range.Text = "✔"; } else if (a5.Text == "商标异议申请") { doc.Bookmarks.get_Item(ref MyBM[5]).Range.Text = "✔"; } else if (a5.Text == "商标异议答辩") { doc.Bookmarks.get_Item(ref MyBM[6]).Range.Text = "✔"; } else if (a5.Text == "更正商标申请/注意事项申请") { doc.Bookmarks.get_Item(ref MyBM[7]).Range.Text = "✔"; } else if (a5.Text == "变更商标申请人/注册人名义/地址 变更集体商标/证明商标管理规则/集体成员名单申请") { doc.Bookmarks.get_Item(ref MyBM[8]).Range.Text = "✔"; } else if (a5.Text == "变更商标代理人/文件接收人申请") { doc.Bookmarks.get_Item(ref MyBM[9]).Range.Text = "✔"; } else if (a5.Text == "删减商品/服务项目申请") { doc.Bookmarks.get_Item(ref MyBM[10]).Range.Text = "✔"; } else if (a5.Text == "商标续展注册申请") { doc.Bookmarks.get_Item(ref MyBM[11]).Range.Text = "✔"; } else if (a5.Text == "商标注册申请") { doc.Bookmarks.get_Item(ref MyBM[12]).Range.Text = "✔"; } else if (a5.Text == "转让/移转申请/注册商标申请书") { doc.Bookmarks.get_Item(ref MyBM[13]).Range.Text = "✔"; } else if (a5.Text == "商标使用许可备案") { doc.Bookmarks.get_Item(ref MyBM[14]).Range.Text = "✔"; } else if (a5.Text == "变更许可人/被许可人名称备案") { doc.Bookmarks.get_Item(ref MyBM[15]).Range.Text = "✔"; } else if (a5.Text == "商标专用权质权登记申请") { doc.Bookmarks.get_Item(ref MyBM[16]).Range.Text = "✔"; } else if (a5.Text == "商标专用权质权登记事项变更申请") { doc.Bookmarks.get_Item(ref MyBM[17]).Range.Text = "✔"; } else if (a5.Text == "商标专用权质权登记期限延期申请") { doc.Bookmarks.get_Item(ref MyBM[18]).Range.Text = "✔"; } else if (a5.Text == "商标专用权质权登记证补发申请") { doc.Bookmarks.get_Item(ref MyBM[19]).Range.Text = "✔"; } else if (a5.Text == "商标专用权质权登记注销申请") { doc.Bookmarks.get_Item(ref MyBM[20]).Range.Text = "✔"; } else if (a5.Text == "商标注销申请") { doc.Bookmarks.get_Item(ref MyBM[21]).Range.Text = "✔"; } else if (a5.Text == "撤销连续三年不使用注册商标申请") { doc.Bookmarks.get_Item(ref MyBM[22]).Range.Text = "✔"; } else if (a5.Text == "撤销成为商品/服务通用名称注册商标申请") { doc.Bookmarks.get_Item(ref MyBM[23]).Range.Text = "✔"; } else if (a5.Text == "撤销连续三年不使用注册商标提供证据") { doc.Bookmarks.get_Item(ref MyBM[24]).Range.Text = "✔"; } else if (a5.Text == "撤销成为商品/服务通用名称注册商标答辩") { doc.Bookmarks.get_Item(ref MyBM[25]).Range.Text = "✔"; } else if (a5.Text == "补发变更/转让/续展证明申请") { doc.Bookmarks.get_Item(ref MyBM[26]).Range.Text = "✔"; } else if (a5.Text == "补发商标注册证申请") { doc.Bookmarks.get_Item(ref MyBM[27]).Range.Text = "✔"; } else if (a5.Text == "出具商标注册证明申请") { doc.Bookmarks.get_Item(ref MyBM[28]).Range.Text = "✔"; } else if (a5.Text == "出具优先权证明文件申请") { doc.Bookmarks.get_Item(ref MyBM[29]).Range.Text = "✔"; } else if (a5.Text == "撤回商标注册申请") { doc.Bookmarks.get_Item(ref MyBM[30]).Range.Text = "✔"; } else if (a5.Text == "撤回商标异议申请") { doc.Bookmarks.get_Item(ref MyBM[31]).Range.Text = "✔"; } else if (a5.Text == "撤回变更商标申请人/注册人名义/地址 变更集体商标/证明商标管理规则/集体成员名单申请") { doc.Bookmarks.get_Item(ref MyBM[32]).Range.Text = "✔"; } else if (a5.Text == "撤回变更商标代理人/文件接收人申请") { doc.Bookmarks.get_Item(ref MyBM[33]).Range.Text = "✔"; } else if (a5.Text == "撤回删减商品/服务项目申请") { doc.Bookmarks.get_Item(ref MyBM[34]).Range.Text = "✔"; } else if (a5.Text == "撤回商标续展注册申请") { doc.Bookmarks.get_Item(ref MyBM[35]).Range.Text = "✔"; } else if (a5.Text == "撤回转让/移转申请/注册商标申请") { doc.Bookmarks.get_Item(ref MyBM[36]).Range.Text = "✔"; } else if (a5.Text == "撤回商标使用许可备案") { doc.Bookmarks.get_Item(ref MyBM[37]).Range.Text = "✔"; } else if (a5.Text == "撤回商标注销申请") { doc.Bookmarks.get_Item(ref MyBM[38]).Range.Text = "✔"; } else if (a5.Text == "撤回撤销连续三年不使用注册商标申请") { doc.Bookmarks.get_Item(ref MyBM[39]).Range.Text = "✔"; } else if (a5.Text == "撤回撤销成为商品/服务通用名称注册商标申请") { doc.Bookmarks.get_Item(ref MyBM[40]).Range.Text = "✔"; } else { doc.Bookmarks.get_Item(ref MyBM[41]).Range.Text = a5.Text; } doc.Bookmarks.get_Item(ref MyBM[42]).Range.Text = a6.Text; doc.Bookmarks.get_Item(ref MyBM[43]).Range.Text = a7.Text; doc.Bookmarks.get_Item(ref MyBM[44]).Range.Text = a8.Text; doc.Bookmarks.get_Item(ref MyBM[45]).Range.Text = a9.Text; doc.Bookmarks.get_Item(ref MyBM[46]).Range.Text = a10_1.Text; doc.Bookmarks.get_Item(ref MyBM[55]).Range.Text = a10_2.Text; doc.Bookmarks.get_Item(ref MyBM[56]).Range.Text = a10_3.Text; /* doc.Bookmarks.get_Item(ref MyBM[47]).Range.Text = a11.Text; * doc.Bookmarks.get_Item(ref MyBM[48]).Range.Text = a12.Text; * doc.Bookmarks.get_Item(ref MyBM[49]).Range.Text = a13.Text; * doc.Bookmarks.get_Item(ref MyBM[50]).Range.Text = a14.Text; * doc.Bookmarks.get_Item(ref MyBM[51]).Range.Text = a15.Text; * doc.Bookmarks.get_Item(ref MyBM[52]).Range.Text = a16.Text; * doc.Bookmarks.get_Item(ref MyBM[53]).Range.Text = a17.Text; * doc.Bookmarks.get_Item(ref MyBM[54]).Range.Text = a18.Text;*/ doc.SaveAs(ref aa); doc.Close(); this.Enabled = true; }