求助高手,我在asp中用以下代码合并三个word文档生成一个新的word文档,其中20080407210是学号。我的问题是怎样从数据库中读取学号,然后合并相关的word文档?- <%
- Set objWord = CreateObject("Word.Application")
- 'objWord.Visible = True
- Set objDoc = objWord.Documents.Add()
- Set objSelection = objWord.Selection
- objSelection.PageSetup.LeftMargin = 2.48/0.035
- objSelection.PageSetup.RightMargin = 2.48/0.035
- objSelection.InsertFile "F:\student\merge_word\20080407210.doc"
- 'objSelection.TypeText vbCrLf 添加一个回车行
- objSelection.InsertFile "F:\student\merge_word\20080407210_1.doc"
- 'objSelection.TypeText vbCrLf 添加一个回车行
- objSelection.InsertFile "F:\student\merge_word\20080407210_2.doc"
- objDoc.SaveAs "F:\paper\20080407210.doc"
- objWord.Quit
- %>
复制代码
|