Not without seeing the code. (Though I am not sure that I can help with
VB.NET, but someone may be able to)

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hello. I am a newbie here. I need some help.
> A little history: I wrote a form letter generation system in VB 4.0 about
[quoted text clipped - 17 lines]
> Thank you for any help,
> Jeff
Doug,
Thank you for the response.
Here is the sub routine that merges the documents.
The process stops at the line with *=*=*=*=*=*=*=*=*
Any ideas would be appreciated.
No errors are returned, the process just stops.
*********************************
Public Sub Do_MailMerge(ByRef wdapp As Word.Application)
Dim adoMergeRS As ADODB.Recordset
Dim strSQL As String
On Error GoTo MergeError
strSQL = "Select * from " & tablename & " where swLetterHistId = " &
adoInitialRS.Fields("swLetterHistId").Value
adoMergeRS = New ADODB.Recordset
'Opening the recordset
adoMergeRS.Open(strSQL, dbconnection, ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockOptimistic)
'Do the mail merge
'' wdapp.Documents(1).MailMerge.MainDocumentType = wdFormLetters''
wdapp.Documents(1).MailMerge.OpenDataSource Name:="",
ConfirmConversions:=False, _
''' ReadOnly:=False,
Connection:="dsn=inCITe1;uid=swb;pwd=vantive;database=vantive",
LinkToSource:=True, AddToRecentFiles:=False, _
''' PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _
''' WritePasswordTemplate:="", Revert:=False,
Format:=wdOpenFormatAuto, _
''' SQLStatement:=strSQL
wdapp.Documents.Item(1).MailMerge.MainDocumentType =
Word.WdMailMergeMainDocType.wdFormLetters
wdapp.Documents.Item(1).MailMerge.OpenDataSource(Name:="",
ConfirmConversions:=False,
ReadOnly:=False,
Connection:=strDSN,
LinkToSource:=True,
AddToRecentFiles:=False,
PasswordDocument:="",
PasswordTemplate:="",
WritePasswordDocument:="",
WritePasswordTemplate:="",
Revert:=False,
Format:=Word.WdOpenFormat.wdOpenFormatAuto, SQLStatement:=strSQL)
'"DSN=inCITe;uid=swb;pwd=Pswrd"
With wdapp.Documents.Item(1).MailMerge *=*=*=*=*=*=*=*=**=*=*=*
.SuppressBlankLines = True
.Destination = Word.WdMailMergeDestination.wdSendToNewDocument
.Execute((False))
End With
'Free Memory
strSQL = ""
'MsgBox "Mailmerge successful so far"
Exit Sub
MergeError:
' MsgBox "Check table " & adoInitialRS!swLetterHistId
Select Case Err.Number
Case 5631 'No records matched the select or they were empty
blnMergeFailed = True
Error_Logger(Err.Number, Err.Description, "Do Mail Merge")
Case 5922 'Word was unable to open the data source
Error_Logger(Err.Number, Err.Description, "Do Mail Merge")
blnMergeFailed = True
Case 462 'The ODBC Connection has been lost,
'Database server or network Connection has failed
Error_Logger(Err.Number, Err.Description, "Do Mail Merge")
blnMergeFailed = True
Close_dbConnection()
Case -2147418111 'Automation error Call was rejected by callee.
Error_Logger(Err.Number, Err.Description, "Do Mail Merge")
blnMergeFailed = True
Close_dbConnection()
Case Else
Error_Logger(Err.Number, Err.Description, "Do Mail Merge")
blnMergeFailed = True
End Select
End Sub
*************************
> Not without seeing the code. (Though I am not sure that I can help with
> VB.NET, but someone may be able to)
[quoted text clipped - 20 lines]
> > Thank you for any help,
> > Jeff
Doug Robbins - Word MVP - 06 May 2008 20:53 GMT
Try it without the ((False))

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Doug,
> Thank you for the response.
[quoted text clipped - 111 lines]
>> > Thank you for any help,
>> > Jeff