Microsoft
Office
Interop
Word 生产w ord 的方法 一、添加页眉 01
using System; 02
using System
Collections
Generic; 03
using System
ComponentModel; 04
using System
Data; 05
using System
Linq; 06
using System
Text; 07
using Word = Microsoft
Office
Interop
Word; 08
using System
IO; 09
using System
Reflection; 10
using Microsoft
Office
Interop
Word; 11
namespace WordCreateDLL 14
public class AddHeader 16
public static void AddSimpleHeader(Application WordApp, string HeaderText) 18
//添加页眉 20
WordApp
ActiveWindow
Type = WdViewType
wdOutlineView; 21
WordApp
ActiveWindow
SeekView = WdSeekView
wdSeekPrimaryHeader; 22
WordApp
ActiveWindow
ActivePane
Selection
InsertAfter(HeaderText); 23
WordApp
Selection
ParagraphFormat
Alignment = WdParagraphAlignment
wdAlignParagraphL