Chancing / remove “ something ” in the subject, online archive

Status
Not open for further replies.

Ronald1913

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hi :)

I need a macro for chancing / remove “ something ” in the subject, for all mails in the online archive ( office365 ).

Thanks
 

Ronald1913

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hi

Does this work for the online archive in office 365?
I only need it for the online archive.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
you need to run it in outlook, on a folder in the online archive. As the macros are written, they work either on the select items or all items in a folder, so you'd need to run it on each folder.

I'm not aware of a way to do it completely online - powershell might be able to do it, but the admin would need to run it AFAIK. (I don't have a powershell script that can do it.)
 

Ronald1913

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hi :)

That is ok, so is it possible to run this macro on the main folder and all subfolders or is it necessary to run it on each folder?
Yes powershell script is a option to.
 

Ronald1913

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hi

I can use this one to edit one email but it can't continue to the next email.

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

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

For Each obj In objItems

With obj

obj.Subject = Replace(obj.Subject, "test", "")
Debug.Print .Subject

End With

Next

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

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
that one should move to the next one - this part tells it to use the current folder and the items in that folder:
Set objFolder = objOL.ActiveExplorer.CurrentFolder
Set objItems = objFolder.Items
For Each obj In objItems

is the word (test in this example) in each subject?

oh, one thing i see i forgot - you need to save the obj for the change to stick - and the keyword is case sensitive.


I tweaked the code with the changes in this snippet -

Code:
Dim i As Long

For Each obj In objItems

With obj
i = i + 1
Debug.Print .Subject
obj.Subject = Replace(LCase(obj.Subject), "test", "")
obj.Save


End With

Next
MsgBox i
 

Ronald1913

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hi and Thanks !

Yes it works fine now like this :
Option Explicit
Public Sub test()
Dim objOL As Outlook.Application
Dim objItems As Outlook.Items
Dim objFolder As Outlook.MAPIFolder
Dim obj As Object

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

Dim i As Long

For Each obj In objItems

With obj
i = i + 1
Debug.Print .Subject
obj.Subject = Replace(obj.Subject, "test", "")
obj.Save


End With

Next
MsgBox i


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


Only one thing more : is it possible for this macro to continue into subfolders ?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T Outlook 2016 remove envelope icon for certain folders Using Outlook 5
M In Outlook Calendar remove the buttons: 'Today' and '<' (Back a day) and '>' (Forward a day) that are below the Ribbon and above the calendar display. Using Outlook 0
P [SOLVED] Auto remove [EXTERNAL] from subject Using Outlook 14
P Add, remove, & reorder folder pane Using Outlook 6
W Remove specific contacts from contact list Outlook VBA and Custom Forms 3
T Cannot remove needless PST Using Outlook 1
Healy Consultants Macro to remove inside organization distribution list email address when reply to all recepients Outlook VBA and Custom Forms 0
S Unable to remove rule outlook 2010 Using Outlook 0
N How to remove signature formatting from Text in Word (accidentally taken from Outlook) Using Outlook 0
B Remove Subject Residual Outlook VBA and Custom Forms 3
P how to remove unwanted PST file default categories assigned to many calendar entries Using Outlook 7
J Remove text to Clean Up Outlook VBA and Custom Forms 1
B Automatically Forward Emails and Remove/Replace All or Part of Body Outlook VBA and Custom Forms 8
D Remove text in subject using VBA Outlook VBA and Custom Forms 4
T Remove Old Location From Tasks Pane Using Outlook 1
A remove or turn off outlook.com contact folder from outlook 2016 Using Outlook 4
Morgan Fowler Remove Signature Using Outlook 1
M How to remove a list of specific contacts from Outlook Using Outlook 18
R New Links on Navigation Pane, How to Remove? Using Outlook 1
M VBA to remove deferred delivery on a MeetingItem Outlook VBA and Custom Forms 2
J Remove extra line above signature in reply Outlook VBA and Custom Forms 5
Diane Poremsky How to Remove RSS Support from Outlook New Slipstick.com Articles 0
Diane Poremsky Remove Attachments From Messages New Slipstick.com Articles 0
Diane Poremsky Remove Office 2013 Update Banner New Slipstick.com Articles 0
O Remove duplicate mail items Outlook VBA and Custom Forms 6
Diane Poremsky Remove a password from an Outlook *.pst File New Slipstick.com Articles 3
G VBA/Macro to remove page colour when replying or forwarding email Outlook VBA and Custom Forms 2
L Fake reminder apperaring (not in calendar) - how to remove? Using Outlook 5
J Your IMAP server wants to alert you to the following: cannot remove system folder Using Outlook 3
A Auto Insert of filename when selecting 'Remove Attachment' Using Outlook 1
C how to remove icons on right hand side outlook 2013 Using Outlook 2
K Remove Manage APPS button for users Exchange Server Administration 1
P Remove name and parenthses from email Using Outlook 1
G Outlook calendar entry corrupted. Constant pop up when you open outlook. Unable to delete or remove. Using Outlook 2
Diane Poremsky How to remove the primary account from Outlook 2010/2013 New Slipstick.com Articles 0
Diane Poremsky Remove an Address from Reply All New Slipstick.com Articles 0
Diane Poremsky Remove Outlook apps from Outlook New Slipstick.com Articles 0
L An () has been inserted after the address in an address box; how do I remove them. Using Outlook 1
S How to remove forms from Organizational forms library Outlook VBA and Custom Forms 2
2 Task has a strike through but is not complete - how to remove? Using Outlook 1
A Is it possible to remove the word Categories: from task list views? Using Outlook 2
W URGENT Cancel and remove imported pop3 mails Using Outlook 6
Emerogork How do I remove "Delete Folder" from the right-click menu? Using Outlook 1
T How to remove annoying Big Blue Type at beginning of my messages Using Outlook 2
H Cannot remove unwanted fields from form Outlook VBA and Custom Forms 9
T How to remove "automatically delete messages form this sender"? Using Outlook 1
M How to remove duplicate history items BCM (Business Contact Manager) 7
D Isn't there an easy way to remove duplicate contacts in outlook? Using Outlook 1
Britonius Exchange Powershell to Remove Reviewer access from all Folders in a mailbox? Using Outlook 3
L automatically remove flags Using Outlook 2

Similar threads

Top