【发布时间】:2019-08-27 04:35:59
【问题描述】:
因此,当我运行代码时,PDF 会获得一个额外的空白页。
试图使分页符连续。 试图删除一个字符。
这些删除页眉和页脚,但它们是必需的。
Sub Word_ExportPDF()
Dim i As Long
Dim CurrentFolder As String
Dim FileName As String
Dim myPath As String
myPath = ActiveDocument.FullName
CurrentFolder = ActiveDocument.Path & "\"
FileName = Mid(myPath, InStrRev(myPath, "\") + 1, _
InStrRev(myPath, ".") - InStrRev(myPath, "\") - 1)
With ActiveDocument
For i = 102 To .Sections.Count
.Sections(i).Range.Select
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
CurrentFolder & "Section " & i & ".pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False,
OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportSelection, Item:= _
wdExportDocumentContent, IncludeDocProps:=False, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks,
DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
Next i
End With
End Sub
只需在我的 PDF 末尾创建一个额外的空白页。
【问题讨论】: