我如何使用vb.net从多个单词docs创建一个单词doc [英] how do I using vb.net create one word doc from multiple word docs

查看:105
本文介绍了我如何使用vb.net从多个单词docs创建一个单词doc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将报告输出为MS Word文档的应用程序。这是因为用户需要偶尔修改报告。我有一个报告的1页模板,报告可以是1页或50页,具体取决于数据。我可以正确地创建所有文档,但是当使用insert创建包含所有页面的一个文档时,它会失败。如何让它工作



文件名在表格中

I have an application that outputs reports as MS Word documents. This is because the user needs to occasionally modify the reports. I have a 1 page template for one of the reports and the report can be 1 page or 50 pages depending upon the data. I can create all the documents properly, but when using insert to create one document containing all the pages, it fails. How do I get this to work

the file names are in a table

    For lngZ = 1 To lngRecs
         strTempDoc = Tempset("FileName")
          If lngZ = 1 Then
             objWord.Documents.Add (strTempDoc) '  for the first document to be added use Documents.Add method
             Selection.MoveEnd Unit:=wdLine, Count:=1
          Else
               bX = InsertFile(strTempDoc, Range, ConfirmConversions, Link, Attachment)
               Selection.MoveEnd Unit:=wdLine, Count:=1
          End If
'          intGG = Instance.EndKey(Unit:=6)   '''' here
'            Selection.EndKey Unit:=wdStory, Extend:=wdMove
            Tempset.MoveNext
            If Tempset.EOF Then
                Exit For
            End If
    Next

推荐答案

请参阅:使用VB.NET将Word文档合并为单个文档的页面 [ ^ ]或者这里:合并Word文档 [ ^ ]
See this: Merge Word Documents As Pages Of A Single Document Using VB.NET[^] or here: Merge Word Documents[^]


这篇关于我如何使用vb.net从多个单词docs创建一个单词doc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆