本文介绍了如何使用html将页眉页脚添加到世界文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请任何人告诉我如何使用html为MS单词添加页眉和页脚
在此先感谢
Please any one tell me how to add the header and footer for the MS word using html
Thanks in advance
推荐答案
namespace OOXML
{
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
public class WordProcess
{
/// read header and footer strings from html and then call AddHeader
/// by passing the existing word file
public void AddHeader(string wordFile, string header, string footer)
{
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(wordFile, true))
{
foreach (HeaderPart hp in wordDoc.MainDocumentPart.HeaderParts)
{
// add/modify header values
Header h = hp.Header;
}
foreach (FooterPart fp in wordDoc.MainDocumentPart.FooterParts)
{
// add/modify footer values
Footer f = fp.Footer;
}
}
}
}
}
如需更多帮助,请访问此链接
http://openxmldeveloper.org/ [ ^ ]
For more help visit this link
http://openxmldeveloper.org/[^]
这篇关于如何使用html将页眉页脚添加到世界文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!