2013-03-08 87 views
0

我想調整我使用C#編寫的程序生成的Excel文件的打印設置。我想設置爲:'頁面適合(或適合)1頁'。 (在荷蘭語中是Blad passend maken voor 1 pagina):p 您可以選擇此選項:screenshotC#Excel打印邊距

我知道利潤通過PageSetup對象設置,但我無法找到如何做到這一點。

請幫我在這裏:)

+2

[這是否回答你的問題?](http://stackoverflow.com/questions/2602408/set-margins-in-excel-using-excel-interop-vb-net) – 2013-03-08 15:44:55

回答

1

這可能有幫助嗎?

osheet.PageSetup.PrintArea = "$A$5:$G$" & curLine + 1 
osheet.PageSetup.PrintTitleColumns = "$A:$A" 
osheet.PageSetup.PrintTitleRows = "$1:$4" 
osheet.PageSetup.Orientation = XlPageOrientation.xlLandscape 
osheet.PageSetup.CenterFooter = "SomeText" 
obook.CustomViews.Add("Print Top Left", True, True)