Excel 365打印预览 [英] Excel 365 Print Preview

查看:519
本文介绍了Excel 365打印预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7 Home 64位上使用Excel 365。当我从Excel用户界面打开打印预览时,我得到一个窗口,其中包含以下选项:



https://www.flickr.com/photos/132482128@N08/21711947524/in/dateposted-public/



从这个窗口我可以预览整个打印文件,调整边距,选择要使用的打印机等。我想从VBA访问这个窗口和这些选项。但是当我使用:

  ActiveWorkbook.Sheets(SheetName)。PrintOut Preview:= True 

或:

  ActiveWorkbook。 Sheets(SheetName)。PrintPreview EnableChanges:= True 

我收到一个包含以下选项的窗口:



https://www.flickr.com/photos/132482128@N08/21713621773/in/dateposted-public/



我只能查看第一个打印文件的页面,我无法更改打印机。我已经尝试过:

  Application.Dialogs(xlDialogPrint)。显示
pre>

但它仍然不会打开现代的Excel 365 PrintPreview对话框,不允许我定义要打印的内容。



我做错了什么?

如何获取新的365类型PrintPreview?



BTW - 使用。 Word 365 VBA中的PrintPreview方法会按照您的期望打开365 PrintPreview对话框。

解决方案

尝试这样:

  Application.CommandBars.ExecuteMsoPrintPreviewAndPrint

参考:本工作簿中的第649行:



http://excelhero.com/resource/excel2013ribboncontrolidentifiers.xlsx


I'm using Excel 365 on Windows 7 Home 64bit. When I open Print Preview from the Excel user interface I get a window with options like this:

https://www.flickr.com/photos/132482128@N08/21711947524/in/dateposted-public/

From this window I can preview the whole print file, make adjustments to margins, select the printer to use, etc. I would like to access this window and these options from VBA. However when I use:

ActiveWorkbook.Sheets("SheetName").PrintOut Preview:=True

or:

ActiveWorkbook.Sheets("SheetName").PrintPreview EnableChanges:=True

I get a window with options like this:

https://www.flickr.com/photos/132482128@N08/21713621773/in/dateposted-public/

I can only view the first page of the print file, and I am unable to change the printer. I have tried this:

Application.Dialogs(xlDialogPrint).Show

but it still does not bring up the modern Excel 365 PrintPreview dialogue and doesn't allow me to define what I want printed.

What am I doing wrong?
How do I get the new 365 type PrintPreview?

BTW - Using the .PrintPreview method in Word 365 VBA brings up the 365 PrintPreview dialogue, as you would expect.

解决方案

Try this:

Application.CommandBars.ExecuteMso "PrintPreviewAndPrint"

Reference: row 649 in this workbook:

http://excelhero.com/resource/excel2013ribboncontrolidentifiers.xlsx

这篇关于Excel 365打印预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆