Home > Software engineering >  VBA call outlook
VBA call outlook

Time:09-23

Wrote the following code calls the outlook email, but want to excel in the table as attached chart also in the picture in the mail, a great god please help take a look at how to modify the following statement
 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. JPG

Then in the Attachments. The Add D: \ Temp. JPG
  •  Tags:  
  • VBA
  • Related