Code Samples - Document Converter Pro

Example 3: How to convert an URL - Visual Basic 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
   Dim urlToConvert : urlToConvert = "http://neevia.com"

   Dim DC : Set DC = CreateObject("Neevia.docConverter")

   DC.setParameter "DocumentOutputFormat", "PDF"
   DC.setParameter "DocumentOutputFolder", "c:\users\public\"
   DC.setParameter "PDFAutoRotatePage", "All"

   Dim rv : rv = DC.submitUrl(urlToConvert, "neevia.url", "")

   If (rv <> 0) Then
     MsgBox " *** submitUrl error **** "
   Else
     rv = 2
     While (rv = 2)
       rv = DC.checkStatus("neevia.url", "")
       DC.doSleep 1000
     Wend

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