Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Calendaring / May 2006

Tip: Looking for answers? Try searching our database.

Is it possible to delete appt. item from folder obtained from GetSharedDefaultFolder?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian J. Matuschak - 29 Apr 2006 01:16 GMT
Greetings:

I'm working on an Excel automation application used for scheduling
(can't rewrite it now in a better environment).  Here's a snippet of
the code I used to generate the AppointmentItem:

strResource = lblFullName.Caption

bytCount = Selection.Columns.Count
bytCol = ActiveCell.Column
' Dates are in top row
strStartDate = Cells(1, bytCol)
strEndDate = Cells(1, bytCol + bytCount - 1)

Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objMailItem1 = objOutlook.CreateItem(olMailItem)
Set objReqAttendee = objMailItem1.Recipients.Add(strResource)
objReqAttendee.Resolve
If objReqAttendee.Resolved Then
'    Create appointment
Set objFolder = objNameSpace.GetSharedDefaultFolder(objReqAttendee,
olFolderCalendar)
If Not objFolder Is Nothing Then
Set objAppItem = objFolder.Items.Add
End If
If Not objAppItem Is Nothing Then
strNote = InputBox("Would you like to add additional
information to the event notice?", _
"Add descriptive text for event")
End If
If strNote  "" Then
objAppItem.Body = strNote
End If
With objAppItem
Start = CDate(strStartDate & " 12:00:00 AM")
End = CDate(strEndDate & " 11:00:00 PM")
AllDayEvent = True
Subject = strEventID
BusyStatus = olBusy
Save
End With
Set objMailItem2 = objOutlook.CreateItem(olMailItem)
Set objReqAttendee = objMailItem2.Recipients.Add(strResource)
With objMailItem2
Subject = "Scheduling for " & strEventID
Body = "You have been scheduled for " & strEventID & " for " &
strStartDate & " to " & strEndDate & "." & _
" Please contact the Resource Calendar for details."
Save
Send
End With
Else
MsgBox "The name you selected doesn't match what's in the Outlook
Global Address List." & _
vbCrLf & "Try editing the name to match what is in Outlook."
End If
Set objOutlook = Nothing
Set objNameSpace = Nothing
Set objMailItem1 = Nothing
Set objMailItem2 = Nothing
Set objReqAttendee = Nothing
Set objAppItem = Nothing
------
Given that scheduling is dynamic around here, I've been asked to see if
I can remove an AppointmentItem from someone else's calendar when I use
this technique.  Is it possible?

Thanks,

Brian J. Matuschak
v-brmatu@microsoft.com; brian@electronic-atlas.com

Signature

Brian J. Matuschak

Sue Mosher [MVP-Outlook] - 29 Apr 2006 17:19 GMT
You would need permission to delete items in the other person's folder.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

>
> Greetings:
[quoted text clipped - 69 lines]
> Brian J. Matuschak
> v-brmatu@microsoft.com; brian@electronic-atlas.com
Brian J. Matuschak - 01 May 2006 20:16 GMT
Thanks, I thought it was the case.  Now I have to find a snippet that
will allow me to do this. ;-)

'Sue Mosher [MVP-Outlook Wrote:
> ']You would need permission to delete items in the other person's
> folder.
[quoted text clipped - 9 lines]
> Brian J. Matuschak
> v-brmatu@microsoft.com; brian@electronic-atlas.com

Signature

Brian J. Matuschak


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.