harmmeijer
Programmer
I have opened an additional folder in outlook 2000 that is used as a goup mailbox.
In outlook I can open the calendar and add appointments here but with automation I haven't got a clue on how to do this.
I can get the folder and add an item folder.items.add(1) but when I save the item it ends up in my folder under calendar not in the group account folder.
Here is the vba code, note that this eventually has to run in javascript.
Greetings, Harm Meijer
In outlook I can open the calendar and add appointments here but with automation I haven't got a clue on how to do this.
I can get the folder and add an item folder.items.add(1) but when I save the item it ends up in my folder under calendar not in the group account folder.
Here is the vba code, note that this eventually has to run in javascript.
Code:
Dim nameOfMyfolder As String
Dim nameOfGroupfolder As String
nameOfMyfolder = "Mailbox - myname"
nameOfGroupfolder = "Mailbox - helpdesk"
Dim out As Outlook.Application
Set out = New Outlook.Application
Dim f As MAPIFolder
Dim i As Integer
i = 1
Do While i < out.GetNamespace("MAPI").Folders.Count + 1
Dim s As String
s = out.GetNamespace("MAPI").Folders(i).Name
If s = nameOfGroupfolder Then
Set f = out.GetNamespace("MAPI").Folders(i)
MsgBox "OK f is now: " & f.Name
End If
i = i + 1
Loop
If f Is Nothing Then
MsgBox "Please add the ""additional folderes""" & vbCrLf & _
"In outlook under tools -> services -> microsoft excha" & _
"nge server -> properties -> advanced -> add"
Exit Sub
End If
' OK, got the group folder, now put an appointment in there
Dim aItem As AppointmentItem
Set aItem = f.Items.Add(olAppointmentItem)
aItem.MeetingStatus = 1
If aItem.Parent.Parent.Name = nameOfMyfolder Then
MsgBox "Why does it create the calendar item in MY folder when " & _
"I invoke items.add on the GROUP folder????"
MsgBox "The appt has to be in the group folder, no use saving it in my folder"
Exit Sub
End If
aItem.Subject = "new subject"
aItem.Send
Greetings, Harm Meijer