Scripting Example Visual Basic.NET
Top  Previous  Next

Related example scripts: Examples\Visual Basic

You can then use the function of the Scripting Interface to control iMacros. The following example is part of a Visual Basic project that creates an iMacrosBrowser instance, plays a macro and checks for errors - this example assumes the existence of a function called void Log(String logString), which logs messages.

Imports Status = InternetMacros.Status

Public Class Form1
    Inherits System.Windows.Forms.Form

  Private m_app As InternetMacros.App


  Private Sub startIMacros() 
    Const cmdTimeout = 60

    Dim s As InternetMacros.Status

    m_app = New InternetMacros.App


    s = m_app.iimInit("", True, "", "", 5)


    s = m_app.iimPlay("demo-extract", cmdTimeout)


    If s > 0 Then
      Log("Macro completed ok")
    ElseIf s < 0 And s > -100 Then
      Log("Interface problem: " + CStr(s))
    Else
      Log("Macro problem: " + CStr(s))
    End If

    s = m_app.iimExit()


  End Sub

End Class






Page URL http://www.iopus.com/imacros/help/scriptingexamplevb.htm