Excel Interop Print

前端 未结 2 1306
别那么骄傲
别那么骄傲 2021-02-09 08:48

I need to print a selected area of an excel sheet (which I selected with Range.Select()) using the following print settings:

Printer: Microsoft XPS Document Writer
P

2条回答
  •  我寻月下人不归
    2021-02-09 09:29

    For the 'Fit Sheet on One Page' to work we should also set the Zoom property to false.

    // Fit Sheet on One Page

    _with1.FitToPagesWide = 1;
    
    _with1.FitToPagesTall = 1;
    
    _with1.Zoom = False;
    

提交回复
热议问题