2013-03-08 97 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)