Sub Send_Email ()
Dim OutlookApp As Outlook. Application
Dim Outlookitem As Outlook. MailItem
The Set OutlookApp=New Outlook. Application
The Set Outlookitem=OutlookApp. The CreateItem (olMailItem)
Receiver="XX @ * *. Com"
Carbon="* * *. Com"
SubjectText="[TDDV daily]"
BodyText="2222"
AttachedObject="E: \ @ data group Shared, transition, TDDV daily, east China TDDV daily. XLSX"
On Error GoTo SendEmail_Error
With Outlookitem
To=Receiver
. CC=Carbon
The Subject=SubjectText
The Body=BodyText
If AttachedObject & lt;> "" Then
. Attachments. The Add AttachedObject
End the If
. Send
End With
SendEmail_Exit:
The Exit Sub
SendEmail_Error:
MsgBox Err. The Description
Resume SendEmail_Exit
End Sub
CodePudding user response:
That might want to open the first AttachedObject excel file, SavePicture will map to the local, for example, D: \ Temp. JPGThen in the Attachments. The Add D: \ Temp. JPG