Code Samples - Document Converter Pro

Example 2: How to convert a file (submitFileEx method) - VB.NET Copy 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
   Dim fileToConvert As String = "c:\users\public\test.doc"

   Dim DC As Object
   DC = CreateObject("Neevia.docConverter")

   DC.setParameter("DocumentOutputFormat", "PDF")
   DC.setParameter("PDFAutoRotatePage", "All")

   Dim rv As Integer
   rv = DC.submitFileEx(fileToConvert,"c:\docs\out","c:\docs\error","c:\docs\orig")

   If (rv <> 0) Then
     MsgBox(" *** submitFileEx error **** ")
   Else
     rv = 2
     While (rv = 2)
       rv = DC.checkStatusEx(fileToConvert,"c:\docs\out","c:\docs\error")
       Application.DoEvents()
       DC.doSleep(1000)
     End While

     If (rv = 0) Then
       MsgBox(" Converted successfully")
     Else
       MsgBox(" Error converting")
     End If
   End If