Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Sub EmptyJunkEmailFolder()
Dim outapp As Outlook.Application
Set outapp = CreateObject("outlook.application")
Dim olitem As Object
Dim fldJunk As Outlook.MAPIFolder
Set fldJunk = outapp.GetNamespace("MAPI").GetDefaultFolder(olFolderJunk)
For Each olitem In fldJunk.Items
olitem.Delete
Next
Set fldJunk = Nothing
Set olitem = Nothing
Set outapp = Nothing
End Sub
Public Sub EmptyJunkEmailAndDeletedFolder()
Dim outapp As Outlook.Application
Set outapp = CreateObject("outlook.application")
Dim olitem As Object
Dim fldJunk As Outlook.MAPIFolder
Dim fldDeleted As Outlook.MAPIFolder
Set fldJunk = outapp.GetNamespace("MAPI").GetDefaultFolder(olFolderJunk)
For Each olitem In fldJunk.Items
olitem.Delete
Next
Set fldDeleted = outapp.GetNamespace("MAPI").GetDefaultFolder(olFolderDeletedItems)
For Each olitem In fldDeleted.Items
olitem.Delete
Next
Set fldJunk = Nothing
Set fldDeleted = Nothing
Set olitem = Nothing
Set outapp = Nothing
End Sub