Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Apr 17, 2018 5:57 pm

Using Pro version (6.4.5.4040) with vb.net. The last line produces an error which is attached. Not sure what is causing this.

Code: Select all
 strSelect = "SELECT doc_id, doc_image FROM cldocs " &
                    "WHERE doc_id = 11"

        'Dim myconn As New SqlConnection(conn)
        Dim sda As New SqlDataAdapter(strSelect, objConnection)

        Dim myds As New DataSet()
        If objConnection.State = ConnectionState.Closed Then objConnection.Open()
        sda.Fill(myds)
        objConnection.Close()
        Dim Files() As Byte = CType(myds.Tables(0).Rows(0)("doc_image"), Byte())

        Dim objDocument As New Document()
        Dim oms As New MemoryStream(Files)
        objDocument.LoadFromStream(oms, FileFormat.Docx)

        Dim PrintDialogDoc As New PrintDialog

        PrintDialogDoc.AllowPrintToFile = True
        PrintDialogDoc.AllowCurrentPage = True
        PrintDialogDoc.AllowSomePages = True
        PrintDialogDoc.UseEXDialog = True

        objDocument.PrintDialog = PrintDialogDoc

        Dim PrintDocument2 As PrintDocument = objDocument.PrintDocument

        PrintDocument2.Print()


jstiegler
 
Posts: 18
Joined: Fri Mar 23, 2018 5:35 pm

Wed Apr 18, 2018 2:19 am

Hello,

Thanks for your post. I am afraid you have not replaced the other dlls when updating to the latest version except Spire.Doc.dll. Please remove all the old dlls of Spire in your application and reference the new ones from the same folder. Below are the details of the dlls. Please have a check.
Code: Select all
Spire.Doc.dll  6.4.5.4040
Spire.License.dll  1.3.6.40
Spire.Pdf.dll  4.4.0.2040


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Wed Apr 18, 2018 3:58 pm

This worked. Thank you.

jstiegler
 
Posts: 18
Joined: Fri Mar 23, 2018 5:35 pm

Thu Apr 19, 2018 1:23 am

Hello,

Thanks for your feedback. Just feel free to contact us if you have other questions.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.Doc