Sub MakeTentative()
Dim objItem As Object
Set objItem = GetCurrentItem()
If Not TypeOf objItem Is AppointmentItem Then
MsgBox ("Not an appointment")
Exit Sub
End If
Set objItem.BusyStatus = 1
objItem.Save
End Sub
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
End Function
|