怎样在test.aspx所在目录新建一个test.doc文件
test.aspx是一个web窗体,用来在web中打开。SOACtrl.WebOpen("test.doc",SOAOfficeX.soaWorkMode.docNoRe...
test.aspx是一个web窗体,用来在web中打开。
SOACtrl.WebOpen("test.doc", SOAOfficeX.soaWorkMode.docNoRevision, "当前用户名", "Word.Document");这一句怎样解释?引号里的test.doc怎样在test.aspx页面中创建? 展开
SOACtrl.WebOpen("test.doc", SOAOfficeX.soaWorkMode.docNoRevision, "当前用户名", "Word.Document");这一句怎样解释?引号里的test.doc怎样在test.aspx页面中创建? 展开
展开全部
public void CreateWordFile()
{
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word._Application oWrod = new Microsoft.Office.Interop.Word.Application();
oWrod.Visible = true;
Microsoft.Office.Interop.Word._Document oDoc = oWrod.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
//Add new table
object start = 0;
object end = 0;
Microsoft.Office.Interop.Word.Range tableLocation = oDoc.Range(ref start, ref end);
oDoc.Tables.Add(tableLocation, 3, 4, ref oMissing, ref oMissing);
oDoc.Tables[1].Cell(1, 1).Range.Text = "test0";
oDoc.Tables[1].Cell(2, 2).Range.Text = "Test8989898989";
}
{
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word._Application oWrod = new Microsoft.Office.Interop.Word.Application();
oWrod.Visible = true;
Microsoft.Office.Interop.Word._Document oDoc = oWrod.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
//Add new table
object start = 0;
object end = 0;
Microsoft.Office.Interop.Word.Range tableLocation = oDoc.Range(ref start, ref end);
oDoc.Tables.Add(tableLocation, 3, 4, ref oMissing, ref oMissing);
oDoc.Tables[1].Cell(1, 1).Range.Text = "test0";
oDoc.Tables[1].Cell(2, 2).Range.Text = "Test8989898989";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询