locked
Trying to print Word documents authomatically, "PrintFile" is not recognized as object RRS feed

  • Question

  • User-786564416 posted

    I am trying to print MS Words automatically>

    I installed the neodynamics WebClientPrint and added it as reference...

    My code is as following:

    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.Configuration
    Imports System.Diagnostics
    Imports System.Globalization
    Imports System.Drawing.Printing
    Imports System.Collections.Generic
    Imports System.IO
    Imports Microsoft.Office.Interop
    Imports Neodynamic.SDK.Web
    
    Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
            If (WebClientPrint.ProcessPrintJob(Request)) Then
    
                Dim useDefaultPrinter As Boolean = (Request("useDefaultPrinter") = "checked")
                Dim printerName As String = Server.UrlDecode(Request("printerName"))
                Dim docFilePath As String = "c:\myDocument.doc"
    
                Dim fileName As String = Guid.NewGuid().ToString("N") + System.IO.Path.GetExtension(docFilePath)
                Dim file As New PrintFile(docFilePath, fileName)
                Dim cpj As New ClientPrintJob
    
             End If
    End Sub

    The bolded underlined statement PrintFile is not recognized as an object. What is the missing thing and why it is not recognized?

    Tuesday, April 12, 2016 6:05 AM