Fax VB.NET – Retrieve Outbound Fax Image with GetFaxImage

25 Nov 2016 This code sample is deprecated and in process of being removed. Check out our new code libraries and usage documentation on InterFAX @ Github.
Download the fax VB.NET project files.

These project files allow you to retrieve the image of an outbound (previously-submitted) fax with VB.NET. This is done using the GetFaxImage method.

The fax VB.NET snippet below demonstrates retrieval of an outbound fax image using GetFaxImage.


Sub Main()
        Dim username As String = "my username"
        Dim password As String = "my password"
        Dim transactionID As Long = 196805130
        Dim imageData() As Byte = Nothing   ' the image data will be retrieved to here

        Dim ifws As New interfax.InterFax()
        Dim st As Long = ifws.GetFaxImage(username, password, transactionID, imageData)
        If st = 0 Then
            IO.File.WriteAllBytes("c:\temp\1.tif", imageData)
            Console.WriteLine("Image properly saved to file. Total bytes: " & imageData.Length)
        Else
            Console.WriteLine("An error occured; result is: " & st)
        End If
    End Sub