本文介绍了如何在Word 2007模板中使用OpenXML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Word 2007模板中使用OpenXML?
我要替换模板标记
并生成文档
在asp.net c#
对不起,我的英语很不好,我正在学习
Help
how to use OpenXML with word 2007 template?
I want to replace the template markers
and generate the document
in asp.net c #
sorry for my English is very bad I''m learning
Help
推荐答案
Run run1 = new Run();
Text text1 = new Text();
text1.Text = "This is a fake template, and here is the DATA1";
run1.Append(text1);
paragraph1.Append(run1);
但您可以将其更改为:
but you''d change it to this:
Run run1 = new Run();
Text text1 = new Text();
text1.Text = "This is a fake template, and here is the "+DATA1;
run1.Append(text1);
paragraph1.Append(run1);
并在运行时替换所有变量.
And replace all your variables at runtime.
这篇关于如何在Word 2007模板中使用OpenXML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!