Excel 向附加到Outlook on VBA的PDF文档中添加其他页面
我目前正在发送一个pdf文档中的信息,该文档是从我的excel工作表生成的 我的问题是,我有太多的信息,一页,所以我需要把它放在三个pdf页面,而不仅仅是一个 这是我当前的代码,只允许1页Excel 向附加到Outlook on VBA的PDF文档中添加其他页面,excel,vba,pdf,Excel,Vba,Pdf,我目前正在发送一个pdf文档中的信息,该文档是从我的excel工作表生成的 我的问题是,我有太多的信息,一页,所以我需要把它放在三个pdf页面,而不仅仅是一个 这是我当前的代码,只允许1页 Sub SendPDFInfo() ' Create PDF of active sheet and send as attachment. ' Dim strPath As String, strFName As String Dim Out
Sub SendPDFInfo()
' Create PDF of active sheet and send as attachment.
'
Dim strPath As String, strFName As String
Dim OutApp As Object, OutMail As Object
'Create PDF of active sheet only
strPath = Environ$("temp") & "\" 'Or any other path, but include trailing "\"
strFName = ActiveWorkbook.Name
strFName = Left("Information", InStrRev(strFName, ".") - 1) & ".pdf"
Range("b4:u63").Select
ActiveSheet.PageSetup.PrintArea = "$b$4:$u$63"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
strPath & strFName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
'Set up outlook
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
'Create message
On Error Resume Next
With OutMail
.to = "client email; " 'Insert required address here
########
.CC = "Email in CC"
.BCC = ""
.Subject = "Information"
.Body = "Good Morning," & vbCr & " " & vbCr & "Please information attached," & vbCr & " " & vbCr & "Best regards," & vbCr & "Name" & vbCr & "Number"
.Attachments.Add strPath & strFName
.Display 'Use only during debugging ##############################
'.Send 'Uncomment to send e-mail ##############################
End With
End Sub
提前谢谢你 似乎您只需更改Excel工作表中的布局、字体等,即可将其打印在三页上。