vba 如何使用横向发布pdf

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23937296/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 03:18:45  来源:igfitidea点击:

How to publish pdf using Landscape orientation

vba

提问by Buras

I ve been trying to publish a .pdffile from an excel worksheet

我一直在尝试.pdf从 Excel 工作表中发布文件

    Selection.ExportAsFixedFormat _
    Type:=xlTypePDF, _
    Filename:="C:\TestFolder\temp.pdf", _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=True , _
    Orientation:=xlLandscape

However, the last line does not work the way I expect ?

但是,最后一行没有按我预期的方式工作?

How can I publish a landscape oriented pdf ?

如何发布面向景观的 pdf ?

采纳答案by zukah

It looks like "Orientation" isn't a parameter for ExportAsFixedFormat (see library reference here).

看起来“方向”不是 ExportAsFixedFormat 的参数(请参阅此处的库参考)。

I would recommend first setting the page orientation on the selected sheet using something like this:

我建议首先使用以下内容在所选工作表上设置页面方向:

ActiveSheet.PageSetup.Orientation = xlLandscape