打印预览 [英] PrintPreview

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

问题描述

尝试在我的宏底部打印预览。


当我这样做时,我只得到可见屏幕的图像。


想要我的打印区域打印预览。还是新的。任何人都可以帮忙吗?


Sub Macro46()

'打印图例并在DL标题上设置打印区域

    表格("1-100 Log")。选择

   范围("B2:V20")。选择

   范围("B20")。激活

    Selection.CopyPicture外观:= xlScreen,格式:= xlBitmap

   表格("DL标题")。可见=真

   表格("DL表头")。选择

   范围("A128:AJ135")。选择

    ActiveSheet.Paste

    Selection.ShapeRange.Width = 607

    Selection.ShapeRange.LockAspectRatio = msoFalse

    Selection.ShapeRange.Height = 77.5

    Selection.ShapeRange.ZOrder msoBringToFront

   范围("AO26:BQ39")。选择

'复制标题和图例并粘贴日志打印并移至所需位置

   表格("DL标题")。可见=真

   表格("DL表头")。选择

   范围("A97:AJ136")。选择

   范围("A97")。激活

    Selection.CopyPicture外观:= xlScreen,格式:= xlPicture

   表格("每日打印1英寸")。选择

   范围(范围("AW26")。值,范围("BB26")。值)。选择

    ActiveSheet.Paste

    Selection.ShapeRange.Height = 445

    Selection.ShapeRange.LockAspectRatio = msoFalse

    Selection.ShapeRange.Width = 565

    Selection.ShapeRange.ZOrder msoBringToFront

   范围("AO26:AJ87")。选择

   表格("DL表头")。选择

    ActiveWindow.SelectedSheets.Visible = False

   表格("每日打印1英寸")。选择

   范围(范围("AW26")。值,范围("BG26")。值)。选择

    ActiveSheet.PageSetup.PrintArea = Range(" AW26")。Value& ":" &安培;范围("BG26")。价值

   

    'ActiveSheet.PageSetup.PrintArea.PrintPreview

   

End Sub

解决方案

你好Frank2day,



我想确认。

你看不到PrintPreview的屏幕吗?或其他问题?

请提供有关您的问题的更多详细信息。

这是我的真实样本:ActiveSeet.PrintPreview的结果。

       

' - 印刷时のパラメータをセット
With ActiveSheet.PageSetup
.PaperSize = xlPaperA4' - A4
.Orientation = xlLandscape' - 横置き
.Zoom = False' - 拡大缩小なしで,横1ページ·縦1ページに收める
.FitToPagesWide = 1
.FitToPagesTall = 1
.TopMargin = Application.CentimetersToPoints(1)
.FooterMargin = Application.CentimetersToPoints(0.5)
.CenterHorizo​​ntally = True' - 水平位置·中央
.CenterVertically = True' - 垂直位置·中央
结束
' - プリンター选択&印刷
ActiveSheet.PrintPreview' - 印刷プレビューの表示


问候,


Trying to get to print preview at the bottom of my macro.

Seems when I do it I only get the an image of the visible screen.

Wanting my print area to print preview. Still new at this. Can any one help with this?

Sub Macro46()
' Prints Legend and sets print area on DL Header
    Sheets("1-100 Log").Select
    Range("B2:V20").Select
    Range("B20").Activate
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
    Sheets("DL Header").Visible = True
    Sheets("DL Header").Select
    Range("A128:AJ135").Select
    ActiveSheet.Paste
    Selection.ShapeRange.Width = 607
    Selection.ShapeRange.LockAspectRatio = msoFalse
    Selection.ShapeRange.Height = 77.5
    Selection.ShapeRange.ZOrder msoBringToFront
    Range("AO26:BQ39").Select
'Copy's header and legend and pastes over log print and moves to desired spot
    Sheets("DL Header").Visible = True
    Sheets("DL Header").Select
    Range("A97:AJ136").Select
    Range("A97").Activate
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
    Sheets("Daily Prints 1 inch").Select
    Range(Range("AW26").Value, Range("BB26").Value).Select
    ActiveSheet.Paste
    Selection.ShapeRange.Height = 445
    Selection.ShapeRange.LockAspectRatio = msoFalse
    Selection.ShapeRange.Width = 565
    Selection.ShapeRange.ZOrder msoBringToFront
    Range("AO26:AJ87").Select
    Sheets("DL Header").Select
    ActiveWindow.SelectedSheets.Visible = False
    Sheets("Daily Prints 1 inch").Select
    Range(Range("AW26").Value, Range("BG26").Value).Select
    ActiveSheet.PageSetup.PrintArea = Range("AW26").Value & ":" & Range("BG26").Value
   
    'ActiveSheet.PageSetup.PrintArea.PrintPreview
   
End Sub

解决方案

Hi Frank2day,

I would like to confirm.
Can't you see a screen of PrintPreview? or other issue?
Please provide more details about your issue.
This is my real sample: result of ActiveSeet.PrintPreview.
      

' -- 印刷時のパラメータをセット
With ActiveSheet.PageSetup
    .PaperSize = xlPaperA4      ' -- A4
    .Orientation = xlLandscape  ' -- 横置き
    .Zoom = False       ' -- 拡大縮小なしで、横1ページ・縦1ページに収める
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    .TopMargin = Application.CentimetersToPoints(1)
    .FooterMargin = Application.CentimetersToPoints(0.5)
    .CenterHorizontally = True  ' -- 水平位置・中央
    .CenterVertically = True      ' -- 垂直位置・中央
End With
' -- プリンター選択&印刷
ActiveSheet.PrintPreview    ' -- 印刷プレビューの表示

Regards,


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

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