代码之家  ›  专栏  ›  技术社区  ›  Malfist

如何在Word中插入页脚?

  •  0
  • Malfist  · 技术社区  · 15 年前

    我用它打开Word中的RTF并将其保存为PDF:

                    Object oMissing = System.Reflection.Missing.Value;    //null for VB
                    Object oTrue = true;
                    Object oFalse = false;
    
                    Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
                    Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
    
                    oWord.Visible = false;
                    Object rtfFile = filename;
                    Object saveLoc = sfd.FileName;
                    Object wdFormatPDF = 17;    //WdSaveFormat Enumeration
                    oWordDoc = oWord.Documents.Add(ref rtfFile, ref oMissing, ref oMissing, ref oMissing);
                    oWordDoc.SaveAs(ref saveLoc, ref wdFormatPDF, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                         ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    
                    oWordDoc.Close(ref oFalse, ref oMissing, ref oMissing);
                    oWord.Quit(ref oFalse, ref oMissing, ref oMissing);
    

    但我也需要在每一页上插入一个页脚。我该怎么做?

    1 回复  |  直到 15 年前
        1
  •  1
  •   Shoban    15 年前

    Check this discussion in MSDN 看看是否有帮助。