以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]预览打印如何直接显示表  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=147376)

--  作者:薛翁
--  发布时间:2020/3/15 10:49:00
--  [求助]预览打印如何直接显示表
打印一个Excel文件(仅A4一页):
直接打印是可以的
预览并打印不显示表,必须点状态栏闪动的Excel图标才能显示表。
我的问题是,预览打印如何直接显示表?
请赐教,谢谢!

    Dim App As New MSExcel.Application
    Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(file1)
    Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
    wb.saved = True
    App.DisplayAlerts = False
    App.Visible = True
    If  e.Form.Controls("RdoButP").checked   Then
        If _Mrdyj <> "" Then    \'存在默认打印机(已读入到 _Mrdyj全局本来)
            Ws.PrintOut(Preview:=False,ActivePrinter:=" & _Mrdyj & ")    \'直接打印;
        Else
            Ws.PrintOut(Preview:=True)     \'预览后打印
        End If
    Else
       Ws.PrintPreview(True)
       \' Ws.PrintOut(Preview:=True)
    End If
    App.Quit




--  作者:有点蓝
--  发布时间:2020/3/15 21:03:00
--  
这个和系统以及打开的其它程序有个。另外使用代码把execl前置:http://www.foxtable.com/webhelp/topics/2713.htm