Empty an Office365 public folder containing 20.000 messages

Status
Not open for further replies.

SaintNick

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
It used to be possible with OWA to empty a public folder. That option is now gone.

MFCMAPI tool also can't open the PF store (MAPI_E_NOT_FOUND == 0x8004010F at CallOpenEntry).

Delete and recreate the folder is not an option because among other things it's email enabled, and it's a thing I need to do frequently.

Anyone else any idea's?

Powershell script maybe? Although that would be APITA because first I'd have to disable two-factor authentication in the admin center. (Powershell does not support 2F-authentication).
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Could you run a macro to empty it from one of the computers?

This might work, although it likely would need changed to count down...


Code:
Option Explicit
Public Sub DoSomethingFolder()
    Dim objOL As Outlook.Application
    Dim objItems As Outlook.Items
    Dim objFolder As Outlook.MAPIFolder

    Set objOL = Outlook.Application
    Set objFolder = objOL.ActiveExplorer.CurrentFolder
    Set objItems = objFolder.Items

Dim i As Long
  For i = objFolder.items.Count To 1 Step -1
  objFolder.items(i).Delete
  Next

  Set obj = Nothing
  Set objFolder = Nothing
  Set objOL = Nothing
End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Dang Enter key. :) Not only did i post it before it was finished, i also forgot a few lines. :)

The updated code above should delete all messages in the currently selected folder. It uses the macro at Working with All Items in a Folder or Selected Items as the base, but because it's deleting messages, you need to count backwards, otherwise you'll only delete every other one.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
S Conditional formatting problem with "is not empty" and categories Using Outlook 2
Daniel Schunk User-defined form arrives empty at the recipient Using Outlook 3
semnaitik Archive PST is not empty but can't see old emails Using Outlook 2
M Multiple spurious empty folders appear in archive files Using Outlook 3
B Choose commands from Macros is empty Outlook VBA and Custom Forms 3
I Many empty Contacts folders.. cannot get rid of them Using Outlook 4
wisedave IMAP Mail Directory Keeps Going Empty Using Outlook 5
A Mysterious random appearance of empty unsent email Using Outlook 3
A Prompt on exit to empty deleted items folder "for all accounts" does not work? Using Outlook 6
M empty fields after Contact History personalisation BCM (Business Contact Manager) 0
S 2010 outlook today looks like an empty email box Using Outlook 4
A email folders appear empty, at first click Using Outlook 2
H Calendar Folder property is empty Using Outlook 1
M Contact Manager field is empty BCM (Business Contact Manager) 0
S Please help! -- Linked Account field at Business Contacts tab is always empty BCM (Business Contact Manager) 1
B In Box Empty Using Outlook 5
P Imap Folders are present, but the inbox folder is empty except for new message Using Outlook 3
V What is wrong with Outlook Connector - it still errors out on an EMPTY Hotmail Using Outlook.com accounts in Outlook 3
M How to clean duplicate/empty e-mail address fields in Outlook contacts Using Outlook 0
C Exchange 2010 - empty First Administrative Groups / LegacyExchangeDNs needed for MIIS generated contacts ? Exchange Server Administration 0
U How can I restore .pst files to a now empty Outlook from which I accidently removed them? Using Outlook 1
C Outlook 2010 'empty folder' Using Outlook 4
L Outlook 2010 sending out empty emails with outlook connector Using Outlook 1
M Outlook 2007 always tries to send 4 messages even when Outbox is empty Using Outlook 1
J Re: Outlook 2010: The task list is empty in the to do bar but there are many tasks there. Using Outlook 4
G Re: Outlook 2010: The task list is empty in the to do bar but there are many tasks there. Using Outlook 1
C Emails appear empty but I know they are not Using Outlook 1
J Empty PSTs for multiple users, Outlook 2003 Using Outlook 1
J Multiple empty (265KB) .pst files--emails seem to be gone Using Outlook 4
B seting up office outlook...during set up, a box showed STMP POP3 for sending emails, the recieving box was empty. What information needs to go into t Using Outlook 2
K Outlook 2010 on Exchange - 'Sent Items' box always empty on client, but populated in OWA Using Outlook 5
A Encrypted emails open as empty emails in Outlook 2010 Using Outlook 1
K Outlook 2010 w/Exchange - Sent Items always empty....? Using Outlook 2
S Room Finder available Room list is empty Exchange Server Administration 1
S Empty Deleted Items Folder - GPO Using Outlook 2
T push "send/receive all folders" and nothing happens, check "Show progress" and it's empty. Using Outlook 10
R OOF Still Not working, Client Access\Public folder is empty in IIS. Using Outlook 7
T Auto fill of e-mail addresses is empty Using Outlook 3
J Empty Exchange 2003 Admin groups in Exchange 2010 environment Exchange Server Administration 4
L Default contacts are empty-complete contacts show in another contacts folder Using Outlook 5
G Exchange 2010 Import - Mailboxes Empty Exchange Server Administration 4
S Room Finder list is empty Exchange Server Administration 3
R PST file is huge but empty Using Outlook 3
J Outlook 2003 IMAP not connecting to server. Local inbox empty. Using Outlook 2
A Empty emails and Outlook crashing when sending emails Using Outlook 3
K Empty Deletions Folder Using Outlook 2
A Re: Blank or Empty GAL with SP1 Exchange Server Administration 9
A Blank or Empty GAL with SP1 Exchange Server Administration 1
K Outlook 2010 won't automatically empty deleted items folder on exit. Using Outlook 2
E user defined fields (empty) Using Outlook 3
Similar threads


















































Top