0
我使用這在Word中打開一個RTF,並將其保存爲PDF:如何在Word中插入頁腳?
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);
但我需要插入每個頁面上的頁腳了。我怎樣才能做到這一點?
謝謝!你不會碰巧知道Word API的文檔在哪裏? – Malfist 2009-12-11 14:35:10
你有沒有檢查tihs? http://msdn.microsoft.com/en-in/library/microsoft.office.interop.word%28en-us,office.11%29.aspx – Shoban 2009-12-11 14:38:31
不,我沒有,謝謝。 – Malfist 2009-12-11 14:40:37