1. Microsoft. Office. Interop. Word. Application wordApp = new ApplicationClass ()
Word object
2. Microsoft. Office. Interop. Word. Document wordDoc = wordApp. Documents. Add (ref Nothing, ref Nothing) Document Object
3. A common parameter of Object Nothing = System. Reflection. Missing. Value
4. wordApp. ActiveWindow. ActivePane. View. SeekView = WdSeekView.
WdSeekCurrentPageHeader: locate the header
5. wordApp. Selection. ParagraphFormat. Borders [WdBorderType. wdBorderBottom]
. LineStyle = WdLineStyle. wdLineStyleNone remove the header line
6. wordApp. ActiveWindow. View. SeekView = WdSeekView. wdSeekMainDocument jumps out of the header.
7. wordApp. Selection. ParagraphFormat. Alignment = WdParagraphAlignment.
WdAlignParagraphCenter aligment (center)
8. Microsoft. Office. Interop. Word. Table policyTab = wordDoc. Tables. Add
(WordApp. Selection. Range, number of rows, column, ref Nothing, ref Nothing); Create a table
9. wordApp. Selection. GoTo (ref oGoToItem, ref oGoToLast, ref Nothing, ref Nothing); locate the page (this is to move the cursor to the end of the content)
10. wordApp. Selection. InsertBreak (ref Nothing); insert a subscriber
11. wordApp. Selection. InsertFile (nofile, ref Nothing, ref contenFalse); insert a file
12. wordApp. Selection. InlineShapes. AddPicture (picName, ref LinkToFile, ref SaveWithDocument, ref Nothing); insert an image
13. wordApp. ActiveWindow. ActivePane. View. SeekView = WdSeekView.
WdSeekCurrentPageFooter; locate the footer
14. wordApp. Selection. TypeText ("write the text to be output at the specified position here"); text input
15. wordDoc. ComputeStatistics (WdStatistic. wdStatisticPages, ref Nothing); get the page number
16. wordDoc. PrintOut (ref Nothing,
Ref Nothing,
Ref Nothing,
Ref Nothing,
Ref Nothing, ref Nothing, ref Nothing );
Call the printer to print (the default printer is called)
17. wordDoc. Close (ref saveChanges, ref Nothing, ref Nothing); document exit
18. wordApp. Quit (ref Nothing, ref Nothing, ref Nothing); exit the word Program