G
Guest
Hi freinds
I am trying to automate the printing of an Excel document through .NET. I got that part working but I need to do some print setttings such as landscape setup when I am printing the Excel sheet and I could not figureout where to set that property
If you can commnent on my mode and give suggestions that will be greatly helpful to me
'-------BEGIN CODE---------
Tr
Dim myExcel = CreateObject("Excel.Application"
Dim myBook = myExcel.Workbooks.Open(Server.MapPath(fileName)
Dim wshnetwork = CreateObject("WScript.Network"
Dim printerpath As String = "\\Faxprint1\IT-HPCLJ8500
wshnetwork.AddWindowsPrinterConnection(printerpath
wshnetwork.SetDefaultPrinter(printerpath
myExcel.DisplayAlerts = Fals
myExcel.FeatureInstall = Fals
myBook.PrintOut(
myBook.close(
myBook = Nothin
myExcel.Quit(
myExcel = Nothin
Catch ex As Exceptio
'Response.Write(ex.ToString
End Tr
'-------END CODE---------
Thanks
Sai
I am trying to automate the printing of an Excel document through .NET. I got that part working but I need to do some print setttings such as landscape setup when I am printing the Excel sheet and I could not figureout where to set that property
If you can commnent on my mode and give suggestions that will be greatly helpful to me
'-------BEGIN CODE---------
Tr
Dim myExcel = CreateObject("Excel.Application"
Dim myBook = myExcel.Workbooks.Open(Server.MapPath(fileName)
Dim wshnetwork = CreateObject("WScript.Network"
Dim printerpath As String = "\\Faxprint1\IT-HPCLJ8500
wshnetwork.AddWindowsPrinterConnection(printerpath
wshnetwork.SetDefaultPrinter(printerpath
myExcel.DisplayAlerts = Fals
myExcel.FeatureInstall = Fals
myBook.PrintOut(
myBook.close(
myBook = Nothin
myExcel.Quit(
myExcel = Nothin
Catch ex As Exceptio
'Response.Write(ex.ToString
End Tr
'-------END CODE---------
Thanks
Sai