'Convert Doc' ActiveX Interface

Using 'Convert Doc' as an ActiveX Component

Overview

For COM+ (i.e. with IIS) users click here.

One very important note is that the file, ConvertDoc.EXE is both an executable application AND an ActiveX component.  Again, the file ConvertDoc.EXE, can be ran as a stand alone application, and can be referenced as a component within your development environment. There is only one installation for 'Convert Doc'. ConvertDoc.exe is installed in the Program Files folder of your operating system.


For Visual Basic users, simply make a reference to the ConvertDoc.EXE application in the Tools\References menu item.  Once done you now have access to the ConvertDoc component. In other development environments such as VBA you may use something similar to the lines of code below to create an instance of the 'Convert Doc' application object:

    Dim oConvertDocObject as Object

    Set oConvertDocObject = CreateObject("Convertdoc.clsConvertDoc")

    Call oConvertDocObject.DoCommandLine("/JE:\Jobs\Test.SII")


Directly below is some VBS (Visual Basic Script). You could put the following 3 lines in a text file, call it Test.VBS and give it a go:

   set converter = WScript.CreateObject("Convertdoc.clsConvertDoc")
   result = converter.DoCommandLine("
/JE:\Jobs\Test.SII")
   MsgBox(result)
 

Here is some sample code illustrating its usage:

To download click the following links:

Public WithEvents cd As ConvertDoc.clsConvertDoc

Private Sub Command1_Click()

  Set cd = New clsConvertDoc

    cd.Key = "" ' Assign Key To the 'Final Key', given upon registration.

    ' Run by the command line.  See 'Convert Doc' documentation for a full listing of

  ' switches and options.

  lRetVal = cd.DoCommandLine("/JE:\Jobs\Test.SII")

    If (lRetVal = 0) Then

    Call MsgBox("Success", , "Automation Testing")

  End If

' DoCommandLine() Return Values

'  0 = Success

' -1 = Shareware expired

' -2 = Command line string empty or invalid

' -3 = Missing required command line argument(s)

' -4 = Some error occurred during the processing, create a log or use verbose switch for details
 

  Set cd = Nothing

End Sub

Sub cd_OnError(lErrorNumber As Long, sErrorString As String)

  Call MsgBox("Error " & CStr(lErrorNumber) & " occurred.  [" & sErrorString & "]")

End Sub

As you can see from the code above, the ActiveX simply wraps the command line feature. So, to learn what you can do with the ActiveX, please refer to the 'Using the Command Line' section of the 'Convert Doc' users manual.

METHODS

     DoCommandLine()
     DESCRIPTION:

      This function emulates doing the command line, but through the COM interface.

      RETURN VALUES:
         0 = Success
        -1 = Shareware expired
        -2 = Command line String empty or invalid
        -3 = Missing required command line argument(s)
        -4 = Some error occurred during the processing, create a log or use verbose switch for details



 

PROPERITES

None

EVENTS

     OnError(lErrorNumber As Long, sErrorString As String)
     DESCRIPTION:

      When an error occurs this event is triggered supplying both the error code and description.  This can be very helpful while troubleshooting and developing.