Mark moved copies as "Read"

Status
Not open for further replies.

Zviedrs

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Dear Diane Poremsky,

I have a year old problem and hopefully with your help I can solve it.

I have created rules to move a copy of every message I sent to a specific Inbox folder. It works fine, but every moved copy shows up as "unread". It takes time to go through all folders and click every copy to be read, therefore - is there a solution to do it automatically? So far on internet I have not found any..

P.S. I still want to have also an original sent message in my Sent Items folder.

Thank you in advance,

Best regards,

Zviedrs
 

Zviedrs

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Yes, I have seen that and have tried to put that in use for several times, but it have not worked so far. Maybe I do something wrong with that function. (Also it keeps pointing at "Private WithEvents Items As Outlook.Items" as compiling error).

Besides, if I read correctly it is for "Use a folder in another pst or Mailbox" but I have the same pst file, maybe here is the broblem?

Thank you in advance!
 

Zviedrs

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
I now see more explanations you gaved, but I am still confused.

1.) You write that I don't need all the code from the page.. you mean that I don't need that function and just this?

Sub Whatever()
Dim Ns As Outlook.NameSpace
Set Ns = Application.GetNamespace("MAPI")
'use the default folder

Set Items = Ns.GetDefaultFolder(olFolderCalendar).Items
'do whatever
End Sub

2.)"When the folder is a subfolder under the default Calendar folder, use this instead:

Set Items = Session.GetDefaultFolder(olFolderCalendar).Folders("SharedCal").Items" - I copy messages not only to one Inbox subfolder, but to almost fifty.. Does this still apply in this form? Or I need to copy it fifty times and each time show new subfolder in "SharedCal"?

Is "olFolderCalendar" for any folder or it determins "Calendar" and should be changed to "olFolderInbox" in my case?

3.) If

"Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Set Items = GetFolderPath("New PST\Sent Items").Items
End Sub"

Should be at "ThisOutlookSession" - then what I exactly copy elsewhere and exactly where - into Module1?

Many thanks again!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Did you put the code at the Top of ThisOutlookSession? Not doing so is one cause of the compile error.

That code, as written, is for moving mail to another pst folder - but it can be used for local folders by changing the folder path or use the code sample at VBOffice.net, linked in the More Information section.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I now see more explanations you gaved, but I am still confused.

1.) You write that I don't need all the code from the page.. you mean that I don't need that function and just this?

Sub Whatever()
Dim Ns As Outlook.NameSpace
Set Ns = Application.GetNamespace("MAPI")
'use the default folder

Set Items = Ns.GetDefaultFolder(olFolderCalendar).Items
'do whatever
End Sub

No, that is just sample code. The function you need is under Use a folder in another pst or Mailbox

2.)"When the folder is a subfolder under the default Calendar folder, use this instead:

Set Items = Session.GetDefaultFolder(olFolderCalendar).Folders("SharedCal").Items" - I copy messages not only to one Inbox subfolder, but to almost fifty.. Does this still apply in this form? Or I need to copy it fifty times and each time show new subfolder in "SharedCal"?

Is "olFolderCalendar" for any folder or it determins "Calendar" and should be changed to "olFolderInbox" in my case?

Using it with 50 is more difficult - you need 50 macros (one for each folder) or a different method.

Are you replying to messages already in those folders? If so, Outlook has a setting to move sent items into the folder with the original when its not in the inbox. It would be better to use that when possible.

3.) If

"Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Set Items = GetFolderPath("New PST\Sent Items").Items
End Sub"

Should be at "ThisOutlookSession" - then what I exactly copy elsewhere and exactly where - into Module1?

You don't necessarily need a module 1 for this code, the GetFolderPath function can go in ThisOutlookSession or in Module 1.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I now see more explanations you gaved, but I am still confused.




1.) You write that I don't need all the code from the page.. you mean that I don't need that function and just this?


Sub Whatever()
Dim Ns As Outlook.NameSpace
Set Ns = Application.GetNamespace("MAPI")
'use the default folder


Set Items = Ns.GetDefaultFolder(olFolderCalendar).Items
'do whatever
End Sub





No, that is just sample code. The function you need is under Use a folder in another pst or Mailbox




2.)"When the folder is a subfolder under the default Calendar folder, use this instead:


Set Items = Session.GetDefaultFolder(olFolderCalendar).Folders("SharedCal").Items" - I copy messages not only to one Inbox subfolder, but to almost fifty.. Does this still apply in this form? Or I need to copy it fifty times and each time show new subfolder in "SharedCal"?


Is "olFolderCalendar" for any folder or it determins "Calendar" and should be changed to "olFolderInbox" in my case?





Using it with 50 is more difficult - you need 50 macros (one for each folder) or a different method.




Are you replying to messages already in those folders? If so, Outlook has a setting to move sent items into the folder with the original when its not in the inbox. It would be better to use that when possible.




3.) If


"Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Set Items = GetFolderPath("New PST\Sent Items").Items
End Sub"


Should be at "ThisOutlookSession" - then what I exactly copy elsewhere and exactly where - into Module1?





You don't necessarily need a module 1 for this code, the GetFolderPath function can go in ThisOutlookSession or in Module 1.
 

Zviedrs

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Dear Diane,

Thank you, but I am still going crazy over here..

What I have now is:

Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()

Set Items = Session.GetDefaultFolder(olFolderInbox).Folders("TEXT").Items

End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)
Item.UnRead = False
Item.Save

End Sub

Function GetFolderPath(ByVal FolderPath As String) As Outlook.Folder
Dim oFolder As Outlook.Folder
Dim FoldersArray As Variant
Dim i As Integer

On Error GoTo GetFolderPath_Error
If Left(FolderPath, 2) = "\\" Then
FolderPath = Right(FolderPath, Len(FolderPath) - 2)
End If
'Convert folderpath to array
FoldersArray = Split(FolderPath, "\")
Set oFolder = Application.Session.Folders.Item(FoldersArray(0))
If Not oFolder Is Nothing Then
For i = 1 To UBound(FoldersArray, 1)
Dim SubFolders As Outlook.Folders
Set SubFolders = oFolder.Folders
Set oFolder = SubFolders.Item(FoldersArray(i))
If oFolder Is Nothing Then
Set GetFolderPath = Nothing
End If
Next
End If
'Return the oFolder
Set GetFolderPath = oFolder
Exit Function


GetFolderPath_Error:
Set GetFolderPath = Nothing
Exit Function

End Function

> .at the ThisOutlookSession.

1.) Is this correct for Inbox Subfolder "TEXT"?

2.) How can I get this work?.. Cause, if it is only at the ThisOutlookSession, I have no relation to any project and so I can't run this, can I?

3.) Also - if I have another 50 of these to make - do I paste all of them in ThisOutlookSession one after another?

Thank you in advance!!
 

Forum Admin

Senior Member
I'm checking with the guys who write outlook utility for a living - see if there is a better way.

If not, you would need to combine these two and duplicate it.

Private Sub Application_Startup()
Set Items = Session.GetDefaultFolder(olFolderInbox).Folders("T EXT").Items
End Sub
Private Sub Items_ItemAdd(ByVal Item As Object)
Item.UnRead = False
Item.Save
End Sub
 

Forum Admin

Senior Member
Oh, and you have one other option - disable the option to save sent messages and save (move) them only using rules - use stop processing on every rule and create a 51st rule to save everything else in the sent folder. It's not my favorite and shouldn't be used if the folders are in imap accounts, but it should solve your problem.

Additionally, since you use Outlook 2010 and can view message threads even when filed in different folders, I would consider whether its necessary to move the messages.
 

Zviedrs

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Thank you once again!

I hope to hear the result if any from your other specialists.

Thanks in advance!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Bad news - you'll need 50 macros or 1 macro with the 50 folders listed.
:(
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
One thought occurred to me - what criteria do you use to move messages? Do you move all sent messages? Maybe instead of using a rule to copy, you could use a macro - but this will work best if the criteria is always the same and the folders are named for the criteria. For example, you copy a message sent to a@b.com to a folder named a@b.com.
 

Zviedrs

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
Thank you Diane!

I choose to copy 50 macros then.

But how do I get this macro work?

I have:

Sub Mark_as_read()

End Sub

At "module 1" to have this macro a name and possibility to run

and:

Private Sub Application_Startup()

Set Items = Session.GetDefaultFolder(olFolderInbox).Folders("TEXT").Items

End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)

Item.UnRead = False

Item.Save

End Sub

at "ThisOutlookSession". And still, messages that I have sent and moved with a rule to Inbox subfolder "TEXT" show up as "unread"...

Thank you in advance once again!..
 

Zviedrs

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
P.S. I would preffer one macro with 50 folders listed, but how can I do that?..
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I'll have to test some macros and see which way works best. I think one macro with 50 Case statements will work the best since you aren't using a run a script rule (not supported by after sending rules). You won't use the App startup rule, only the item add.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Now that i think about it, using a macro may not work as expected - it's going to mark all mail placed in that folder as read. This is fine if you don't use rules to move mail there, but won't work if you use rules to move new mail to the folder as it arrives, as they will be marked read.

Do you copy all messages you send or just some? Using an itemadd macro that copies mail placed in the sent folder might work better. It will require a bunch of if statements though.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Something like this is what you need to do -

Code:
Private Sub Items_ItemAdd(ByVal Item As Object) 
 
Set Items = Session.GetDefaultFolder(olFolderSentItems).Items 
 
If Left(Item.Subject, 4) = "Test" Then
   Set MoveTo = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("Test") 
 
Else 
 
If Left(Item.Subject, 6) = "[more]" Then
   Set MoveTo = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("Test") 
 
else 
 
If Item.RecipientAddress = "a@b.com" Then
   Set MoveTo = Session.GetDefaultFolder(olFolderInbox).Parent.Folders("Test") 
 
end if
   Item.UnRead = False
   Item.Copy MoveTo 
 
End Sub
 
D

Deleted member 370

Hi, Zviedrs. Advance warning - this is probably a useless response, but just in case it's not, I thought I'd share. I read your query because I have a similar issue - I send a copy of mail from particular individuals to personal folders - faster than filing. I was annoyed to discover that I couldn't find a similar add-on for Outlook that I have for Mail for Mac (it's called Act-On Mail) that allows me to mark the copy read before it files it, or not create the copy until after the mail is read. Eventually I settled on a low tech solution that I'm mentioning because I noticed that you said that it's time consuming to mark each one read: I just open the folders periodically, select all and choose "mark as read." My thought is that I deal with them as read or not in my main inbox - these are just copies that I keep for history. You could do the same for yours if you don't store unread mail in those boxes. I know it's a bit of a pain. You could probably write a macro to mark your entire folder read periodically, but I'm too lazy. There's always some issue with a macro. Of course it won't work for you if you're truly using separate inboxes, in which case...carry on. Ignore me. :)




-Melody


Tribe of Admins
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
DoctorJellybean Outlook 365 doesn't always mark emails as read Using Outlook 3
O Office 365 Outlook - mark to download Using Outlook 0
S Codes for "Mark Complete" the task Outlook VBA and Custom Forms 2
S Mark as Unread unless Categorized by Color Using Outlook 0
Diane Poremsky Mark Sent Items as Read After Copying with a Rule Using Outlook 0
M Mark Complete keyboard shortcut... on a mac running Windows Bootcamp Using Outlook 0
T Adding "Mark As Complete" btton to Task Remindet Pop-Up Using Outlook 3
F Automatically close email after selecting mark unread Using Outlook 1
T Outlook 2013 either fails to mark messages as read or marks them as read, then un-marks them. Using Outlook 1
Mary B VBscript: Need to copy every email to a folder & mark that copy as read Outlook VBA and Custom Forms 5
C Mark all incoming emails as read Outlook VBA and Custom Forms 3
M How do I mark emails already received as read when I get a second, different email based on subject? Outlook VBA and Custom Forms 3
T outlook 2013 does not mark multiple forward messages as forward Using Outlook 2
7 Macro to mark message as junk and delete Outlook VBA and Custom Forms 3
V Mark BCC when emails is sent from specific account Outlook VBA and Custom Forms 2
B Outlook 2010: how to mark messages without opening? Eg for deletion Using Outlook 2
Z "Mark All as Read" in Outlook 2007 extremely slow Using Outlook 1
N Mark or follow up emails in shared mailbox Using Outlook 2
H mark as read per folder options Using Outlook 1
C Outlook 2010 search for question mark in calendar Using Outlook 7
M Can't mark appointments as private for other user Using Outlook 1
A Mark all as read for public folders Using Outlook 14
I Pound Symbol in emails show as � (black diamond with white question mark inside) - Office 2010. Using Outlook 11
N Changing the 'Mark item as read when selection changes' at runtime Outlook VBA and Custom Forms 1
B Move Sent Email to archival pst folder and mark as read - HOW TO Outlook VBA and Custom Forms 2
B Mark copy of sent email as read - VBA? Outlook VBA and Custom Forms 3
J Pasting into Outlook 2003 produces blue question mark Using Outlook 2
J Mark as read Outlook VBA and Custom Forms 2
M Mark as read Outlook VBA and Custom Forms 5
R Macro to mark item unread Outlook VBA and Custom Forms 2
T Setting a delegate to not mark items as read Using Outlook 9
N Item cannot be saved because it was modified by another user or window, and, Item could not be moved... Using Outlook 0
R Moved 6 months worth (approx 1500 emails) lost from moving from TPG inbox to Icloud inbox (folders) Using Outlook 3
J Moved many emails to Outlook external folder, need to delete on Gmail server Using Outlook 14
C Your mailbox has been temporarily moved ... Using Outlook 2
P Outlook 2013 "Item could not be moved - still an issue for Outlook 2013 Using Outlook 0
S Messages moved / deleted by auto-archive are not synchronized to exchange Exchange Server Administration 8
CWM030 Connected accounts mail moved to trash? Exchange Server Administration 16
N Tracking Mail items being moved to folders Outlook VBA and Custom Forms 5
DAVID A moved the Outlook CST file - All subfolders lost Using Outlook 2
D Is it possible to automatically send an email when it is moved to a folder? Exchange Server Administration 1
Aussie I Change the Subject Line ... but after it is moved the subject has reverted Using Outlook 1
W Shared inbox sub folders not visible when moved Using Outlook 3
D How to forward each email x minutes after it arrives in inbox and hasn't been moved or deleted? Using Outlook 1
D iTunes moved Outlook.com Calendar to Delted Items Using Outlook.com accounts in Outlook 3
S Can't move the items. The item could not be moved. It was either already moved or deleted, or access Using Outlook 3
Stig Arvidsson Need a Script for handling moved mail from inbox Using Outlook 3
Commodore Unified inbox shows moved messages for a while Using Outlook 4
W "You Replied on" Gets Stripped from Emails after they are Moved to Folder Using Outlook 1
S Error 0x80040600 + Cannot move the items. The item cannot be moved . . . Using Outlook 9

Similar threads

Top