home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 March
/
CHIPCD_3_98.iso
/
software
/
testsoft
/
exchange
/
webdata
/
usa
/
lib
/
delete.inc
< prev
next >
Wrap
Text File
|
1997-08-25
|
3KB
|
111 lines
<%
'!--Microsoft Outlook Web Access-->
'!--delete.inc - functions for deleting objects -->
'!--Copyright (c) Microsoft Corporation 1993-1997. All rights reserved.-->
'==CONTENTS=======================
' DeleteItem
' DeleteItemByID
' DeleteItems
'=============================
'=============================
'DeleteItem
'=============================
Sub DeleteItem(obj)
Dim objMoveObj
Dim bIsAuthenticated
Dim strDeletedItemsID
Dim strPublicStoreID
If (Not obj Is Nothing) Then
bIsAuthenticated = Session(bstrAuthenticated)
'Check to make sure user is authenticated. If not authenticated then delete the object.
If bIsAuthenticated then
'Get the deleted items entry id from the session.
strDeletedItemsID = Session(bstrDeletedItemsID)
strPublicStoreID = Session(bstrPublicStoreEntryID)
'If the object is not in the public store or in the Deleted items folder then
'the object is moved to the deleted items folder.
If obj.StoreID <> strPublicStoreID and obj.FolderID <> strDeletedItemsID then
Set objMoveObj = obj.MoveTo(strDeletedItemsID)
If (Err.Number <> 0) Or (objMoveObj Is Nothing) Then
ReportError1 L_errFailDeleteMessage_ErrorMessage
Else
Set objMoveObj = Nothing
End If
Else
'The object is deleted if it is already in the deleted items folder
obj.Delete
If (Err.Number <> 0) Then
ReportError1 L_errFailDeleteMessage_ErrorMessage
End If
End If
Else
obj.Delete
If (Err.Number <> 0) Then
ReportError1 L_errFailDeleteMessage_ErrorMessage
End If
End If
End If
Set obj = Nothing
End Sub
'=======================
' DeleteItemByID
'
' szObj - EntryID for Object
' bIsFolder - Default is false. If it is a folder then pass in True.
' Deletes items in private or public store. Items are actually moved to deleted items
' folder if they are in the private store.
' Dependencies: The session objects must be instantiated before calling this sub.
'=======================
Sub DeleteItemByID(szObj, bIsFolder)
Dim obj
If bIsFolder then
Set obj = OpenFolder(szObj)
Else
Set obj = OpenMessage(szObj)
End If
If (obj Is Nothing) Then
ReportError1 L_errFailDeleteAccess_ErrorMessage
Else
DeleteItem obj
End If
End Sub
'=======================
' DeleteItems
'
' Delete list of items
'=======================
Public Sub DeleteItems
For Each szElement In Request.Form
If IsNumeric(szElement) Then
szEntryID = Request.Form(szElement)
Set objMessage = OpenMessage(szEntryID)
If (objMessage Is Nothing) Then
ReportError1 L_errFailDeleteAccess_ErrorMessage
Else
DeleteItem objMessage
Set objMessage = Nothing
End If
End If
Next
End Sub
%>