Hi,
I'm trying to print/preview the complete results from a merge - the code below only outputs the currently selected merge record. I can scroll thru all merged records on screen but not print or preview the "whole" document. Dim provider As IDocumentFormatProvider = New DocxFormatProvider()
Dim openDialog As New OpenFileDialog()
openDialog.InitialDirectory = Session.WorkFolder & "\letters"
'openDialog.Filter = "Documents|*.docx"
openDialog.Multiselect = False
Dim dialogResult As DialogResult = openDialog.ShowDialog()
If dialogResult = System.Windows.Forms.DialogResult.OK Then
Using stream As Stream = openDialog.OpenFile()
RichTextEditor.Document = provider.Import(stream)
End Using
RichTextEditor.Document.MailMergeDataSource.ItemsSource = WkLetters
RichTextEditor.UpdateAllFields(FieldDisplayMode.Result)
RichTextEditor.MailMerge(True)
RichTextEditor.PrintPreview
End If
Any help would be greatly appreciated.
Regards,
Lee.
I'm trying to print/preview the complete results from a merge - the code below only outputs the currently selected merge record. I can scroll thru all merged records on screen but not print or preview the "whole" document. Dim provider As IDocumentFormatProvider = New DocxFormatProvider()
Dim openDialog As New OpenFileDialog()
openDialog.InitialDirectory = Session.WorkFolder & "\letters"
'openDialog.Filter = "Documents|*.docx"
openDialog.Multiselect = False
Dim dialogResult As DialogResult = openDialog.ShowDialog()
If dialogResult = System.Windows.Forms.DialogResult.OK Then
Using stream As Stream = openDialog.OpenFile()
RichTextEditor.Document = provider.Import(stream)
End Using
RichTextEditor.Document.MailMergeDataSource.ItemsSource = WkLetters
RichTextEditor.UpdateAllFields(FieldDisplayMode.Result)
RichTextEditor.MailMerge(True)
RichTextEditor.PrintPreview
End If
Any help would be greatly appreciated.
Regards,
Lee.