【发布时间】:2010-06-14 10:04:55
【问题描述】:
我需要根据c#中的模板创建一个word文档。我只有段落的标签。有什么方法可以根据用户输入替换模板中已有的项目符号和表格。
我能够使用 Word InterOp 中的替换命令将段落替换为输入文本。
需要帮助才能完成其余的项目。
- 根据用户输入替换项目符号
- 用输入值填写表格
根据标签替换段落的代码:
FindAndReplace(wordApplication, "/date/", DateTime.Now.Date.ToString("MMM dd, yyyy"));
FindAndReplace(){
wordApplication.Selection.Find.Execute(ref findText,
ref matchCase, ref matchWholeWord, ref matchWildCards, ref matchSoundsLike,
ref matchAllWordsForms, ref forward, ref wrap, ref format, ref replaceWithText, ref replace, ref matchKashida,
ref matchDiacritics, ref matchAlefHamsa, ref matchControl);
}
提前致谢。尽快
【问题讨论】: