tags:

views:

102

answers:

1

I'm using this to open an RTF in Word and save it as a 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);

But I need to insert a footer on every page too. How can I do this?

+1  A: 

Check this discussion in MSDN and see if it helps.

Shoban
Thank you! You wouldn't happen to know where the documentation for the Word API is would you?
Malfist
Did you check tihs? http://msdn.microsoft.com/en-in/library/microsoft.office.interop.word%28en-us,office.11%29.aspx
Shoban
No I didn't, thank you.
Malfist