来自模板的文档页脚

时间:2014-01-29 16:09:29

标签: c# ms-word styles

我有一个Word文档,我想将现有模板附加到。

为了将模板样式设置为文档样式,我必须更新样式。

除模板的页脚外,所有模板定义均已成功更新。

//Opening the document to Word application  

Microsoft.Office.Interop.Word.Document wordDoc = null;
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
object oFileName= MyDocumentPath;  
wordDoc= wordApp.Documents.Open(ref oFileName,ref missing, ref missing, ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing,  ref missing);  

//Use an existing template  

object oTemplate = (object)coverPagePath;                   
wordApp.ActiveDocument.set_AttachedTemplate(ref oTemplate);                 
wordApp.ActiveDocument.UpdateStyles();   

有什么想法吗?

0 个答案:

没有答案