100分求助,如何将DataGrid中的数据导入到Word的表格中?
都需要引用那些组件?Office 的版本是2000,要求Word中的表格自动增加,即如果DataGrid中的记录为5条,则Word 的表格也为5条,如果为10条,则Word 的表格自动增加为10条。
最好有原代码!!!
问题点数:100、回复次数:8Top
1 楼cxyPioneer(matt)回复于 2004-07-04 11:17:14 得分 5
upTop
2 楼xiaozikuge(小子酷哥)回复于 2004-07-04 11:28:13 得分 5
up一下吧Top
3 楼zhanglizhao(醉猫)回复于 2004-07-04 11:35:07 得分 0
谢谢了!Top
4 楼zhanglizhao(醉猫)回复于 2004-07-04 12:30:53 得分 0
高手都哪里去了???
郁闷中……Top
5 楼duwx(daledu)回复于 2004-07-04 15:05:48 得分 10
你可以新建一个word模板,然后把内容按照模板的格式导出就是了。Top
6 楼zhanglizhao(醉猫)回复于 2004-07-04 22:22:57 得分 0
各位大侠,还有什么高见没有啊?!Top
7 楼duwx(daledu)回复于 2004-07-05 10:06:03 得分 75
希望对你有帮助。
Word._Application app = new Word.ApplicationClass();
app.Visible = false;
object nothing = System.Reflection.Missing.Value;
object temp = Environment.CurrentDirectory + @"\resume.doc";
Word.Document doc
= app.Documents.Open(ref temp,ref nothing,ref nothing,ref nothing,
ref nothing,ref nothing,ref nothing, ref nothing, ref nothing,
ref nothing,ref nothing,ref nothing,ref nothing,ref nothing,ref nothing,ref nothing);
for (i = 0; i < ds.Tables[3].Rows.Count; i ++)
{
int intTableID = ""; //需要添加内容的tableID
intRow = doc.Tables[intTable].Rows.Count;
doc.Tables[intTable].Cell(intRow,1).Range.Text
= ds.Tables[3].Rows[i]["ExperenceDate"].ToString();
doc.Tables[intTable].Cell(intRow,2).Range.Text
= ds.Tables[3].Rows[i]["Company"].ToString();
doc.Tables[intTable].Cell(intRow,3).Range.Text
= ds.Tables[3].Rows[i]["Department"].ToString();
doc.Tables[intTable].Cell(intRow,4).Range.Text
= ds.Tables[3].Rows[i]["Station"].ToString();
doc.Tables[intTable].Rows.Add(ref nothing);
}Top
8 楼eTopFancy(你的美丽我的回忆)回复于 2004-07-05 11:40:50 得分 5
good good studyTop
相关问题
- 希望将网页上的一个表格导入到 word 文档中,形式也为表格:(
- 如果是以表格形式的word文档导入数据库呢?
- 一个WORD 文档,用表格做的,怎么样把它导入到DW中
- 急!请问在DELPHI中把EXCEL和WORD的表格数据导入在数据库中?
- 如何把一个word或excl做的表格中的数据导入到sql2000中,并且每张表导入到一条数据?
- .net做的表格怎样导入Excel表格中?
- word表格
- 请问是否可以在html页面中把网页中的表格内容导入到word中,我现在可以导入到excel,但不知道怎样导入到word中,请指教!
- 求1.创建一个Word文档,2.把PictureBox控件中的图形导入,3.把RichTextBox控件中的文本导入,4.把MSFlexGrid中的表格数据导入
- 图片导入word!




