Andrey
Attached is the word document. The field is CCAMT5 in the document. The VB code is
Dim createDateTime As DateTime
Dim budgetYear As String
Dim _dt As New DataTable
Dim _courtSubsidy As New CourtSubsidy
createDateTime = Request.QueryString("CreateDateTime")
budgetYear = Request.QueryString("BudgetYear")
Dim windowTitle As String
Dim docPath As String = MapPath(".") & "\Letters\"
Dim doc As Document = New Document(MapPath(".") & "\Letters\CF_COURT_SUB_LT_DD_LTR.doc")
_dt = _courtSubsidy.generateCourtSubDDLetterData(_Conn, createDateTime)
_dt.TableName = "DD_Letters"
doc.MailMerge.RemoveEmptyParagraphs = True
doc.MailMerge.Execute(_dt)
doc.UpdateFields()
doc.MailMerge.DeleteFields()
windowTitle = "Budget Letters for " + budgetYear + " Created on " + createDateTime & " Out.doc"
doc.Save(windowTitle, SaveFormat.Doc, SaveType.OpenInBrowser, Response)
generateCourtSubDDLetterData is a simple sql code that reads a table. You should be able to create a simple data table that has only 2 records in the table. You only need to worry about CCAMT5 field. The last record will no show up in the mail merger.
As for going to 8.1, we had a major problem with exception about having filepath seperators in the file name. 8.1 did not like
Dim doc As Document = New Document(MapPath(".") & "\Letters\CF_COURT_SUB_LT_DD_LTR.doc")
At this point if there is a simple fix for the exception, then we could use it but there are several subrountines using the statements like the one above. Plus, the letter document can reside in different locations, depending on the machine.
We don't want to redo all those routines.
Thanks
Kevin