希望控制Word2000的页眉页脚,在页眉页脚中显示时间、作者、第X页共Y页等等的内容!望有经验的兄弟帮忙!                                            非常感谢!
                                            非常感谢!
                                            非常感谢!
                                            非常感谢!
                                            非常感谢!

解决方案 »

  1.   

    你给WORD加页眉后运行它的宏(在工具-》宏),看看它的VB代码,把它翻译过来就可以了
      

  2.   

    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.TypeText Text:="fgsf"
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
      

  3.   

    to::::jjpan(皮皮lu) 
        我用录制宏的工具录制之后,有一句话翻译不过来!!
    下面是我的代码:请你看看,帮忙改一下
        NormalTemplate.AutoTextEntries("第 X 页 共 Y 页").Insert(PaperDocument.ActiveWindow.Selection.Range);//(这句话汇报错!!!!!)
        就是上面这句话了If (PaperDocument.ActiveWindow.ActivePane.View.Type_=wdNormalView) Or (PaperDocument.ActiveWindow.ActivePane.View.Type_=wdOutlineView) Then
        begin
            PaperDocument.ActiveWindow.ActivePane.View.Type_ := wdPrintView;
        End;
        PaperDocument.ActiveWindow.ActivePane.View.SeekView:= wdSeekCurrentPageFooter;
        NormalTemplate.AutoTextEntries("第 X 页 共 Y 页").Insert(PaperDocument.ActiveWindow.Selection.Range);//(这句话汇报错!!!!!)
        PaperDocument.Application.Selection.TypeText('我的实验');
        PaperDocument.Application.Selection.ParagraphFormat.Alignment := wdAlignParagraphCenter;
        PaperDocument.ActiveWindow.ActivePane.View.SeekView:=wdSeekMainDocument;谢谢!!!!谢谢!!!!谢谢!!!!谢谢!!!!谢谢!!!!谢谢!!!!谢谢!!
      

  4.   

    查了点资料供你参考,应该有帮助:
    procedure TForm1.Button1Click(Sender: Tobject);
    var MSWord: Variant;
    begin
    MSWord := CreateOLEObject('Word.Application');//连接Word
    MSWord.Documents.Open(FileName:='d:\test.doc', ReadOnly:=True);//打开外部Word文档
    MSWord.Visible := 1;//是否显示文件编辑
    MSWord.ActiveDocument.Range(Start:=0, End:=0);//开始改变的启止位置
    MSWord.ActiveDocument.Range.InsertAfter(Text:='Title');//在Word中增加字符'Title'
    MSWord.ActiveDocument.Range.InsertParagraphAfter;
    MSWord.ActiveDocument.Range.Font.Name := 'Arial';//字体名称
    MSWord.ActiveDocument.Range.Font.Size := 24;//字体大小
    end; 
      

  5.   

    该问题已由 things(平)在
    http://expert.csdn.net/Expert/topic/1855/1855791.xml?temp=.9078333
    解决
    uses word2000;var
      vWdFieldNumPages, vwdFieldPage :OleVariant;
    begin
      ,,,
      vWdFieldNumPages := wdFieldNumPages;
      vwdFieldPage := wdFieldPage;
      wordApplication.Selection.Fields.Add(vWdFieldNumPages, ...)就此结题谢谢things(平)!!!谢谢things(平)!!!谢谢things(平)!!!谢谢things(平)!!!谢谢things(平)!!!谢谢things(平)!!!谢谢things(平)!!!谢谢things(平)!!!