【发布时间】:2018-06-28 22:46:29
【问题描述】:
你能帮我解决一下那个代码吗,我是一个正在尝试解决它的初学者。 我正在从特定工作表(第一页)创建 PDF 文件,我想将其添加到带有抄送地址的电子邮件中。
Sub zapisz()
Dim ThisFile As String
Dim OutApp As Object
Dim OutMail As Object
ThisFile = Range("b8").Value & " " & Range("b9").Value & " " & Range("g8").Value & " " & Range("h8").Value
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
ThisFile, Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
From:=1, To:=1, OpenAfterPublish:=False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = ""
.CC = "monika@xx.pl"
.BCC = ""
.Subject = "Oferta xxx"
.Body = "Szanowni Państwo, w załączniku przesyłam ofertę."
.Attachments.Add (ThisFile & "*" & ".pdf")
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub`
【问题讨论】:
-
还有什么问题?您是否遇到特定错误?