Printing Excel in Landscape mode...

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
go into excel and turn on the macro recorder. Then do file=>PageSetup and
change a setting (like landscape)

Turn off the macro recorder.

then look at the recorded code.

--
Regards,
Tom Ogilvy



sai said:
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.
 
Back
Top