Hi Diane - thanks for the reply.
I believe both were doable, but just wasn't sure how to go about it.
I've put some code together that SHOULD ADD
example@example.com to the OptionalAttendees list for the whole year if it doesn't apear in the list already AND then only send update ONLY to this email (updated invitees) but instead it actually REPLACES any OptionalAttendees with
example@example.com and sends the update to all.
In my code below i've tried to use OptionalAttendees.Add but it returns an object error, the code below is the one that actually replaces the OptionalAttendees.
Sub calendar_copy()
Dim MailboxName
Dim Calendar_ID
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim CalFolder As MAPIFolder
Set objOutlook = GetNamespace("MAPI")
Dim CalendarFolder As Outlook.Folder
'- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
'change the mailbox name to that of the shared calendar - for own calendar enter personal email address '-
MailboxName = "
example@example.com" '-
'-
'- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
'This refers to the example Calendar ID
Set myNamespace = Application.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient(MailboxName)
myRecipient.Resolve
Set Calendar_ID = Outlook.Session.GetSharedDefaultFolder(myRecipient, olFolderCalendar)
'- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
Set CalFolder = Calendar_ID
Set calitem = CalFolder.Items
MyStart = "01/01/2013"
MyStart = Format(MyStart, "dd/mm/yyyy")
MyEnd = "31/12/2013"
MyEnd = Format(MyEnd, "dd/mm/yyyy")
'Restricts the subject to "Test a" to "Test z"only
RestrictMeetings = "[Start] >= '" & MyStart & "' AND [End] <= '" & MyEnd & "' And [Subject] > 'Test a' and [subject] < 'Test z'"
Set targetitems = calitem.Restrict(RestrictMeetings)
For Each meetingsubject In targetitems
meetingsubject.OptionalAttendees = "
example@example.com"
meetingsubject.Send
Next
End Sub
Both are doable - you can use VBA to do both or create a custom meeting form that includes the email address. Using a macros means it only works on the computer where the macro is installed. Using a custom form will work on any computer where you use Outlook with your exchange server.