|

楼主 |
发表于 2010-6-13 14:04
|
显示全部楼层
自己晚上挑灯研究 终于搞定啦,不敢独享,把源码公布如下。
哈哈,希望加分!
Sub CLANDAR2OL()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
On Error GoTo cleanup
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value <> "" And _
Cells(cell.Row, "F").Value <> "" And _
Cells(cell.Row, "H").Value = "" Then
Set olApp = New Outlook.Application
Set olApt = olApp.CreateItem(olAppointmentItem)
On Error Resume Next
With olApt
.Start = Cells(cell.Row, "F").Value + TimeValue("9:00:00")
.End = Cells(cell.Row, "G").Value
.Location = "GZ"
.Subject = Cells(cell.Row, "B").Value
.Body = Cells(cell.Row, "K").Value & ">" & Cells(cell.Row, "J").Value & ">" & Cells(cell.Row, "B").Value & ">" & Cells(cell.Row, "F").Value & ">" & Cells(cell.Row, "G").Value & ">" & Cells(cell.Row, "C").Value
.AllDayEvent = False
.BusyStatus = olBusy
.IsOnlineMeeting = False
.ReminderMinutesBeforeStart = 15
.ReminderSet = True
.Recipients = Cells(cell.Row, "C").Value
.Recipients.Add = Cells(cell.Row, "D").Value
.Display = True
.Save
End With
Set olApt = Nothing
End If
Next cell
cleanup:
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub |
评分
-
2
查看全部评分
-
|