I'm trying to automate a process that imports a RDF file into a viewer and exports it as a PDF file.
I've been partially sucessful in automating the process.
I can load multiple RDF files, the program will export a report for each one selected but the report is always for the first file selected in the dialog box. The first document loaded is disposed of but the same document loads again.
I'm not moving to the next file selected in the dlgOpenFile.FileNames.
Is this possible? or, should I add a listbox to the form, import files and run the loop on that?
I'd appreciate any help or suggestions.
'openFileDialog_FileOk - loads selected file into the viewer control
Private Sub dlgOpenFile_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles dlgOpenFile.FileOk
'1) Create a loop in the program logic to load an RDF file or stream into a Document object.
Me.dlgOpenFile.Multiselect = True
Me.cboExportFormat1.SelectedValue = "Portable Document Format (PDF)"
Dim file As String
For Each file In dlgOpenFile.FileNames
' 2) Pass this Document into the PDFExport object's Export method.
Dim filePath As String = Me.PromptSaveFile("Portable Document Format", ".pdf")
Dim pdf As ArExports.Pdf.PdfExport = CType(Me.exportComponent, ArExports.Pdf.PdfExport)
'3) Dispose of the document and repeat the process.
Me.arvMain.Document = Nothing
End Sub 'dlgOpenFile_FileOk