首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过VBA将图纸导出为PDF并放大

通过VBA将图纸导出为PDF并放大
EN

Stack Overflow用户
提问于 2019-03-06 18:11:00
回答 1查看 87关注 0票数 0

我已经有一个代码可以导出到PDF,它导出选定的工作表,但我想使导出的选择在PDF文件中的工作表更大,以帮助稍后的打印阶段。

下面是执行导出的代码:

代码语言:javascript
复制
Sub PDFActiveSheet()
    Dim wsA As Worksheet
    Dim wbA As Workbook
    Dim strTime As String
    Dim strName As String
    Dim strPath As String
    Dim strFile As String
    Dim strPathFile As String
    Dim myFile As Variant
    On Error GoTo errHandler

    Set wbA = ActiveWorkbook
    Set wsA = ActiveSheet
    strTime = Format(Now(), "yyyymmdd\_hhmm")

    strPath = wbA.Path
    If strPath = "" Then
      strPath = Application.DefaultFilePath
    End If
    strPath = strPath & "\"

    strName = Replace(wsA.Name, " ", "")
    strName = Replace(strName, ".", "_")

    strFile = strName & "_" & strTime & ".pdf"
    strPathFile = strPath & strFile

    myFile = Application.GetSaveAsFilename _
        (InitialFileName:=strPathFile, _
            FileFilter:="PDF Files (*.pdf), *.pdf", _
            Title:="Select Folder and FileName to save")

    If myFile <> "False" Then
        wsA.ExportAsFixedFormat _
            Type:=xlTypePDF, _
            Filename:=myFile, _
            Quality:=xlQualityStandard, _
            IncludeDocProperties:=True, _
            IgnorePrintAreas:=False, _
            OpenAfterPublish:=False

        MsgBox "Les QrCodes ont été exporter dans le fichier PDF" _
          & vbCrLf _
          & myFile
    End If

exitHandler:
    Exit Sub
errHandler:
    MsgBox "Erreur lors de l'exportation"
    Resume exitHandler
End Sub
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-06 20:44:54

如果您只是想放大一个固定的%,请在导出行之前使用以下命令

代码语言:javascript
复制
wsA.PageSetup.Zoom = 150 
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55020495

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档