使用Access 2007发送会议请求 [英] Send Meeting Request using Access 2007
问题描述
大家好,我有一个代码(见下文) 要在我的Outlook 2007日历中创建约会,问题是...我想将此约会作为会议请求发送给用户列表,此用户列表已在名为qry_Users的查询中,
看起来像
Hello all, I have a code (see below) to create an appointment in my Outlook 2007 Calendar, the problem is... I want to send this appointment as Meeting request to a list of users, this list of users is already in a query named qry_Users and it looks like
EmployeeID ----  EmployeeEmail
EmployeeID ---- EmployeeEmail
1845 ---- ldiaz@mydomain.com
1845 ---- ldiaz@mydomain.com
1856         ----  mleon@mydomain.com
1856 ---- mleon@mydomain.com
我需要在代码中添加什么以及在何处插入该代码?
what do I need to add to my code and where do I need to insert that code?
帮助将是非常感谢。
谢谢
Lor D
Private Sub cmdAddAppt_Click()
On Error GoTo Add_Err
'Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord
'Exit the procedure if appointment has been added to Outlook.
If Me!Tn_AddedToOutlook = True Then
MsgBox "This appointment is already added to Microsoft Outlook"
Exit Sub
'Add a new appointment.
Else
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Me!Tn_ApptStartDate & " " & Me!Tn_ApptTime
.Duration = Me!Tn_ApptLength
.Subject = Me!Tn_Name
If Not IsNull(Me!Tn_ApptNotes) Then .Body = Me!Tn_ApptNotes
If Not IsNull(Me!Tn_ApptLocation) Then .Location = Me!Tn_ApptLocation
If Me!Tn_ApptReminder Then
.ReminderMinutesBeforeStart = Me!Tn_ReminderMinutes
.ReminderSet = True
.BusyStatus = olFree
End If
Set objRecurPattern = .GetRecurrencePattern
With objRecurPattern
.RecurrenceType = olRecursWeekly
.Interval = 1
'Once per week
'You can hard-wire in these dates or get the
'information from text boxes, as used here.
'.PatternStartDate = #12/1/2003#
.PatternStartDate = Me!Tn_ApptStartDate
'.PatternEndDate = #12/30/2003#
.PatternEndDate = Me!Tn_ApptEndDate
End With
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
End If
'Release the object variables.
Set objOutlook = Nothing
Set objRecurPattern = Nothing
'Set the AddedToOutlook flag, save the record, display
'a message.
Me!Tn_AddedToOutlook = True
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub
Add_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
End Sub
推荐答案
您好任何帮助吗?
Hello any help on this?
谢谢大家,
Ld
这篇关于使用Access 2007发送会议请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!