Hello!
Can someone tell me what statement I have to use to close an Outlook98 email window and also the Outlook explorer window? I tried using something like this:
Set myOlApp = CreateObject("Outlook.Application"
Set myNamespace = myOlApp.GetNamespace("MAPI"
Set myFolder = myNamespace.PickFolder
If myFolder Is Nothing Then
Debug.Print "No Folder selected"
Else
myFolder.Display
Set MyItem = myFolder.Items(1)
MyItem.Display
Dim temp
...
If MsgBox("Are you sure you want to delete this record from Outlook?", vbOKCancel, "Warning!" = vbOK Then
MyItem.Delete
myFolder.Close
Else
MyItem.Close
myFolder.Close
End If
I get error messages when I run this ("Argument not optional" it says for both the myFolder.Close and MyItem.Close statements).
Thanks,
Jisoo22
Can someone tell me what statement I have to use to close an Outlook98 email window and also the Outlook explorer window? I tried using something like this:
Set myOlApp = CreateObject("Outlook.Application"
Set myNamespace = myOlApp.GetNamespace("MAPI"
Set myFolder = myNamespace.PickFolder
If myFolder Is Nothing Then
Debug.Print "No Folder selected"
Else
myFolder.Display
Set MyItem = myFolder.Items(1)
MyItem.Display
Dim temp
...
If MsgBox("Are you sure you want to delete this record from Outlook?", vbOKCancel, "Warning!" = vbOK Then
MyItem.Delete
myFolder.Close
Else
MyItem.Close
myFolder.Close
End If
I get error messages when I run this ("Argument not optional" it says for both the myFolder.Close and MyItem.Close statements).
Thanks,
Jisoo22