D
Derek
I am trying to print a Word document from with an ASP.Net 2005 application.
My code is:
Dim myFile As New FileInfo(fileName)
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" +
(UserSession.LoggedInUser.PrinterName + "^").Replace(" ", "$").Replace("\",
"~") + "Barcode.Doc")
Response.AddHeader("Content-Length", myFile.Length.ToString())
Response.ContentType = "application/msword"
Response.WriteFile(myFile.FullName)
Response.Flush()
When the code runs I am asked "Do you want to save or open this file?".
I click open and a macro runs in the word document and word closes down.
How can I by pass the dialog box and just print the document?
My code is:
Dim myFile As New FileInfo(fileName)
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" +
(UserSession.LoggedInUser.PrinterName + "^").Replace(" ", "$").Replace("\",
"~") + "Barcode.Doc")
Response.AddHeader("Content-Length", myFile.Length.ToString())
Response.ContentType = "application/msword"
Response.WriteFile(myFile.FullName)
Response.Flush()
When the code runs I am asked "Do you want to save or open this file?".
I click open and a macro runs in the word document and word closes down.
How can I by pass the dialog box and just print the document?