|
楼主 |
发表于 2012-8-24 14:06
|
显示全部楼层
本帖最后由 leijingda 于 2012-8-24 14:06 编辑
Dim OutlookApp As Outlook.Application
Dim newMail As Outlook.MailItem
Dim n As Integer, i As Integer
Dim a As String
'Dim ws As Worksheet
Dim xlapp As Excel.Application
Dim xlBook As Workbook
Dim xlSheet1 As Worksheet
Set xlBook1 = ActiveWorkbook
Set xlSheet1 = ActiveWorkbook.Sheets(1)
Set OutlookApp = CreateObject("Outlook.Application")
For i = 1 To 3
Set newMail = OutlookApp.CreateItem(0)
With newMail
.To = xlSheet1.Cells(1, 1)
.CC = xlSheet1.Cells(1, 2)
.Subject = xlSheet1.Cells(1, 3)
.Body = xlSheet1.Cells(1, 4).Text
.BodyFormat = olFormatHTML
.HTMLBody = "<BODY><FONT size=2><P> 您好<BR><BR> Quote() <BR><BR></FONT>" + _
"<P><FONT size=2>" + _
"<P style=margin-left:250>你的姓名" + _
"<BR>" + FormatDateTime(Now, vbShortDate) + _
"</P>" + _
"----------------------------------------------" + _
"<BR>你的工作单位/联系地址" + _
"<BR><BR>电话/传真:###-####-#### 邮编:######" + _
"<BR>----------------------------------------------" + _
"</FONT><br><br>" + Quote() + _
"</BODY>"
olMail.BodyFormat = olFormatPlain
olMail.Display
End With
以上代码是在本论坛搜的,试了一下可用,预先设的信纸和签名都没有了,只能通过代码来加了,可是html的代码我不太熟悉,要慢慢的试,麻烦版主操心了。无比感激。 |
|