Dear lotustower,我知道是难为您了。但这个难题只有您才能帮我解决,其它高手好像都没有会这个的。 因为 FireWall 您进入 ExcelHome 有艰难,那我发邮件给您,好吗?您上面这个email address lotustower2@yahoo.com.cn 我之前试过好像不行,请另外给我一个。谢! 您说要我上载最后的版本指的是您最后帮我做的代码吗?现附上如下: Option Explicit ' Set reference to Microsoft Excel 11 Object Library Private Sub Application_Startup() CreateNewAM End Sub Private Sub CreateNewAM() Dim XL_app As Excel.Application Dim XL_wb As Excel.Workbook Dim OLAitem As Outlook.AppointmentItem Dim Bodytxt As String Dim i As Integer Dim LastRow As Integer Dim RowsCount As Integer Dim Msg As String Dim Rng As Range Dim HaveItem As Boolean HaveItem = False Set XL_app = CreateObject("Excel.Application") Set XL_wb = XL_app.Workbooks.Open("E:\OL_Reminder.xls") Bodytxt = "今天到期生产单号" & Chr(10) i = 9 With XL_app.Workbooks("OL_Reminder.xls").Sheets(1) Do While .Cells(i, 1) <> "" If Cells(i, 7) = 0 Or Cells(i, 10) = 0 Then ' 0 = 今天到期 HaveItem = True Bodytxt = Bodytxt & .Cells(i, "B") & Chr(10) End If i = i + 1 Loop End With If Not HaveItem Then Bodytxt = "今天没有到期生产单号!" On Error GoTo 0 Set OLAitem = CreateItem(olAppointmentItem) '工作 On Error Resume Next With OLAitem .Subject = "今天到期的工作" .Start = Now .End = Now .ReminderMinutesBeforeStart = 30 '30分钟前提醒 .Body = Bodytxt .Save .Display End With XL_app.ActiveWorkbook.Saved = True XL_app.Workbooks.Close XL_app.Quit Set XL_app = Nothing End Sub
[此贴子已经被作者于2006-3-8 20:10:23编辑过] |