See the screen shot below: Categories: Office: Word, Excel, Outlook. Click the SHOW button or the MOVE UP / MOVE DOWN buttons as you see fit.
((._Document)document). Click the item you are missing (like HEADING 2) or out of order. Object filename = Environment.GetFolderPath() + "\\Attachments\\Exams.docx" Retrieve the data and insert into new rows.įirstTable.Cell(intRow, 1).Range.Text = reader.ToString() įirstTable.Cell(intRow, 2).Range.Text = dates SqlDataReader reader = cmd.ExecuteReader() SqlCommand cmd = new SqlCommand("select ExamName,Date from Exam where CourseNum='" + course_number + "'", connection) Table firstTable = (para1.Range, 1, 2, ref missing, ref missing) įirstTable.Cell(1, 1).Range.Text = "Exam Name" įirstTable.Cell(1, 2).Range.Text = "Exam Date" .Table firstTable = (para1.Range, 4,2, ref missing, ref missing) Create a 5X5 table and insert some dummy record = "Exam Dates :" + Environment.NewLine HeaderRange.Text = "Exam Dates for the " + course_name
= .WdParagraphAlignment.wdAlignParagraphCenter Get the header range and add the header details. Document document = (ref missing, ref missing, ref missing, ref missing) įoreach (.Section section in document.Sections) Create a missing variable for missing value Set status for word application is to be visible or not. Set animation status for word application Application winword = new .Application()
I am using this code to create Word file Programmatically using C#, when I create it, I have aproblem that it is repeat the header of the First page to all of pages of the Documents, How I can set it to put the header for the first Page of the Document only?Īnd that's my code : public void create_Document()