【发布时间】:2017-03-06 07:19:15
【问题描述】:
我正在尝试将 excel 工作表导出为 pdf。有什么方法可以使用 VBA 将 pdf 属性设置为fit to visible。
谢谢
下面是我正在使用的代码 sn-p
With wksSalesAndQuotaScoreCard
'.PageSetup.LeftMargin=Application.InchesToPoints(0.7)
.PageSetup.LeftMargin = Application.InchesToPoints(0.7)
.PageSetup.RightMargin = Application.InchesToPoints(0.7)
.PageSetup.TopMargin = Application.InchesToPoints(0.75)
.PageSetup.BottomMargin = Application.InchesToPoints(0.75)
.PageSetup.HeaderMargin = Application.InchesToPoints(0.3)
.PageSetup.Orientation = xlLandscape
.PageSetup.PrintTitleRows = "_SalesandQuotaScoreCardView"
.PageSetup.CenterHorizontally = True
.PageSetup.Order = xlDownThenOver
.PageSetup.FitToPagesWide = 1
''.PageSetup.Zoom = 50
Set rngSalesAndQuotaView = Range(.Shapes("_SalesandQuotaViewFrame").TopLeftCell.Offset(0, -1), .Shapes("_SalesandQuotaViewFrame").BottomRightCell.Offset(1, 0))
rngSalesAndQuotaView.Select
End With
wksScoreCardPayoutView.Select
wksSalesAndQuotaScoreCard.Select False
Selection.ExportAsFixedFormat xlTypePDF, IncludeDocProperties:=True, openafterpublish:=True
wksCustomizeScoreCard.Activate
【问题讨论】:
-
出于理解原因,请分享您已经完成的编码
-
@FatTony 我想将pdf的缩放级别设置为
fittovisible -
您是否尝试过录制您手动对 PDF 执行操作的宏?
-
您使用的是哪个 pdf 查看器?
标签: excel pdf-generation vba