Mailmerge问题与源文档中的表无法拆分 [英] Mailmerge problem with a table in the source document that can not be split
问题描述
你好,
Hello,
我正在做一个mailmerge用函数mailmerge和一个数据库SQL Server (2008R2)。
I am doing a mailmerge with the function mailmerge and a database SQL Server (2008R2).
在我的主文档中,有一个表,用户取消选中允许Word将文档的一部分放在一个页面中的选项以及可以' t进入第二页的第一页。文档的一行有很多行(事实上,主要的
文档只有一个表有两列。第一个是图片,第二个是关于图片的解释。
In my main document, there is a table where the user has unchecked the option that allows Word to put a part of the document in one page and the things that can't go in the first page on the second. A row of the document has a lot of lines (in fact the main document has only one table with two columns. The first one is a picture and the second some explanations about the picture.
当我这样做一个mailmerge时,文件都只在一个word文档中设置(这就是我想要的,所以我选择了选项3 for MaindocumentType。。)
问题是我的表分为两页,第三条记录。我希望第三条记录会在第二页开始,因为表是假设的永远不会分成两页,因为允许一个表占用多个页面的选项是
未选中。
When I do a mailmerge like that the documents are all set in only one word document (that is what I want so I have chosen the option 3 for MaindocumentType).
The problem is that my table is split in two pages for the third record. I would expect that the third record would start in the second page as the table is supposed never be split in two pages as the option to allow a table to take more than one page has been
unselected.
使用 TempDoc.MailMerge
。 MainDocumentType = 3 ' Word.WdMailMergeMainDocType.wdFormLetters '                                                                .OpenDataSource 名称:= User.PathRes &安培; " res.odc",  LinkToSource:= True时,  AddToRecentFiles:= False, _ ''                                                 的SQLStatement:=" SELECT&NBSP * NBSP; FROM  [tb_custcorrespPos]鸟其中  si_prjid = QUOT;&NB sp;& CStr(si_PrjID) & " And si_posID =" & si_PosID, Connection:= str_Con
.OpenDataSource (名称:= AllWinUser.PathRes & " res.odc" , LinkToSource:= True , AddToRecentFiles:= False , SQLStatement:= " Select *  ;从   [tb_CustCorrespPos]鸟一个 加入   [tb_custcorrespPrj]鸟b 关于  a.si_PrjID  =  b.si_PrjID 其中   a.si_PrjID  = " & si_PrjID.ToString & " 订购 a.PosName" , Connection:= str_Con.ToString)
.SuppressBlankLines = True
With TempDoc.MailMerge
.MainDocumentType = 3 ' Word.WdMailMergeMainDocType.wdFormLetters' .OpenDataSource Name:=User.PathRes & "res.odc", LinkToSource:=True, AddToRecentFiles:=False, _'' SQLStatement:="SELECT * FROM [tb_custcorrespPos] where si_prjid=" & CStr(si_PrjID) & " And si_posID=" & si_PosID, Connection:=str_Con
.OpenDataSource(Name:=AllWinUser.PathRes & "res.odc", LinkToSource:=True, AddToRecentFiles:=False, SQLStatement:="Select * from [tb_CustCorrespPos] a join [tb_custcorrespPrj] b on a.si_PrjID = b.si_PrjID Where a.si_PrjID = " & si_PrjID.ToString & " Order by a.PosName", Connection:=str_Con.ToString)
.SuppressBlankLines = True
.FirstRecord = 1 ; Word.WdMailMergeDefaultRecord.wdDefaultFirstRecord
.LastRecord = -16 ' Word.WdMailMergeDefaultRecord.wdDefaultLastRecord
.FirstRecord = 1 ' Word.WdMailMergeDefaultRecord.wdDefaultFirstRecord .LastRecord = -16 ' Word.WdMailMergeDefaultRecord.wdDefaultLastRecord
结束 使用
。执行(真)
结束 使用                                 
EndWith .Execute(True) End With
有人可以告诉我我缺少什么吗?
Can someone please tell me what I am missing?
谢谢
Marc
推荐答案
您好
Marc ,
感谢您发帖。
我会帮助您让其他人帮助您。响应可能会有一些延迟。感谢您的耐心。
最好的问候,
Hi Marc,
Thank you for posting.
I will help you involve others to help you. There might be some delay about the response. Appreciate your patience.
Best Regards,
这篇关于Mailmerge问题与源文档中的表无法拆分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!