//从控件中导出输出到html上的内容
private void ExpertControl(System.Web.UI.Control repeater, DocumentType type)
{
//关闭控件的视图状态
repeater.Page.EnableViewState = false;
//初始化HtmlWriter
System.IO.StringWriter writer = new System.IO.StringWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter(writer);
repeater.RenderControl(htmlWriter);
object path; //文件路径变量
string strContent = StripHTML(htmlWriter.InnerWriter.ToString()); //对html文本处理
Microsoft.Office.Interop.Word.Application wordApp; //Word应用程序变量
Microsoft.Office.Interop.Word.Document wordDoc; //Word文档变量
path = @"D:\政策标引文本.doc"; //路径
wordApp = new Microsoft.Office.Interop.Word.ApplicationClass(); //初始化
//如果已存在,则删除
if (File.Exists((string)path))
{
File.Delete((string)path);
}
//由于使用的是COM库,因此有许多变量需要用Missing.Value代替
Object Nothing = Missing.Value;
wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
string[] temp = strContent.Split('&');
//for (int i =