我想调整我使用C#编写的程序生成的Excel文件的打印设置。我想设置为:'页面适合(或适合)1页'。 (在荷兰语中是Blad passend maken voor 1 pagina):p 您可以选择此选项:screenshot。C#Excel打印边距
我知道利润通过PageSetup
对象设置,但我无法找到如何做到这一点。
请帮我在这里:)
我想调整我使用C#编写的程序生成的Excel文件的打印设置。我想设置为:'页面适合(或适合)1页'。 (在荷兰语中是Blad passend maken voor 1 pagina):p 您可以选择此选项:screenshot。C#Excel打印边距
我知道利润通过PageSetup
对象设置,但我无法找到如何做到这一点。
请帮我在这里:)
你可以操纵Excel中设置使用Office Primary Interop Assemblies
更具体地说,this link告诉您如何使用Excel互操作(PIA办公室的一部分)
操纵页面设置这可能有帮助吗?
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)
[这是否回答你的问题?](http://stackoverflow.com/questions/2602408/set-margins-in-excel-using-excel-interop-vb-net) – 2013-03-08 15:44:55