在开始编写代码之前,先添加对Outlook object library的引用。

 

代码如下:

 

Option Explicit

 

Dim App As Object

Dim Itm As Object

 

Set App = CreateObject("Outlook.Application")

Set Itm = App.CreateItem(0)

With Itm

.Subject = "A tip from vbCode Magician"

.To = ""

.Body =

"认住新VB,真材实料有保证" .Send

End With