Exemplo n.º 1
0
        private void addDocument(Word.Table oTable, loepDocument document)
        {
            try { oTable.set_Style(Doc.Styles["Table Grid"].NameLocal); }
            catch { }
            oTable.Range.ParagraphFormat.SpaceAfter = 0;

            int fileExtPos = document.name.LastIndexOf(".");

            if (fileExtPos >= 0)
            {
                document.name = document.name.Substring(0, fileExtPos);
            }
            oTable.Rows[oTable.Rows.Count - 2].Range.Text          = document.name;
            oTable.Rows[oTable.Rows.Count - 2].Range.Font.Bold     = 1;
            oTable.Rows[oTable.Rows.Count - 2].Range.Font.Size     = 10;
            oTable.Rows[oTable.Rows.Count - 2].Range.Font.Position = 1;
            oTable.Rows[oTable.Rows.Count - 2].Cells[1].Merge(oTable.Rows[oTable.Rows.Count - 2].Cells[2]);
            oTable.Rows[oTable.Rows.Count - 2].Cells[1].Merge(oTable.Rows[oTable.Rows.Count - 2].Cells[2]);
            oTable.Rows[oTable.Rows.Count - 2].Cells[1].Merge(oTable.Rows[oTable.Rows.Count - 2].Cells[2]);
            oTable.Cell(oTable.Rows.Count - 2, 1).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;

            oTable.Rows[oTable.Rows.Count - 1].Range.Font.Size = 10;
            oTable.Rows[oTable.Rows.Count].Range.Font.Size     = 9;
            oTable.Rows[oTable.Rows.Count - 1].Range.Font.Bold = 1;
            oTable.Cell(oTable.Rows.Count - 1, 1).Range.Text   = "From Page";
            oTable.Cell(oTable.Rows.Count - 1, 2).Range.Text   = "To Page";
            oTable.Cell(oTable.Rows.Count - 1, 3).Range.Text   = "Revision";
            oTable.Cell(oTable.Rows.Count - 1, 4).Range.Text   = "Date";
            oTable.Cell(oTable.Rows.Count - 1, 1).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
            oTable.Cell(oTable.Rows.Count - 1, 2).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
            oTable.Cell(oTable.Rows.Count - 1, 3).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
            oTable.Cell(oTable.Rows.Count - 1, 4).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;

            oTable.Cell(oTable.Rows.Count, 1).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
            oTable.Cell(oTable.Rows.Count, 2).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
            oTable.Cell(oTable.Rows.Count, 3).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
            oTable.Cell(oTable.Rows.Count, 4).Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;

            addPages(document.location, oTable);
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Please Save current Doc before proceeding, to countinue?", "Create LOEP?", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                List <loepDocument> loepDocumentArray = new List <loepDocument>();
                foreach (ListViewItem listItem in pageView.Items)
                {
                    loepDocument item = new loepDocument(listItem.SubItems[1].Text, listItem.SubItems[2].Text);
                    loepDocumentArray.Add(item);
                }
                alert = new AlertForm(Doc, 7, loepDocumentArray, 0);
                alert.Show();
                this.Close();
                this.Dispose();
            }
            else
            {
                this.Close();
                this.Dispose();
            }
        }