A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Archive only 'Read e-mails'



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 11th 08, 03:16 PM posted to microsoft.public.outlook
Nabeel
external usenet poster
 
Posts: 9
Default Archive only 'Read e-mails'

Hi,


Is there a way to defined AutoArchiving to only archive read emails
older than a certain period?
Ads
  #2  
Old January 11th 08, 07:21 PM posted to microsoft.public.outlook
Brian Tillman
external usenet poster
 
Posts: 17,452
Default Archive only 'Read e-mails'

Nabeel wrote:

Is there a way to defined AutoArchiving to only archive read emails
older than a certain period?


That's exactly what AutoArchive does, with one exception: it doesn't
distinguish between read and unread. Any message whose modification date is
older than the archive date you choose will be archived.
--
Brian Tillman [MVP-Outlook]

  #3  
Old January 11th 08, 09:13 PM posted to microsoft.public.outlook
JP[_3_]
external usenet poster
 
Posts: 201
Default Archive only 'Read e-mails'

One workaround would be to write some VBA code to set the "Do Not
Archive" flag on Read emails, then when you click on FileArchive,
uncheck "Include items with "Do not AutoArchive" checked." so those
emails would not be moved to archive.


HTH,
JP

On Jan 11, 9:16*am, Nabeel wrote:
Hi,

Is there a way to defined AutoArchiving to only archive read emails
older than a certain period?


  #4  
Old January 11th 08, 10:27 PM posted to microsoft.public.outlook
Nabeel
external usenet poster
 
Posts: 9
Default Archive only 'Read e-mails'

I think you meant setting the 'Do Not archive' on 'unread emails'
and then there would be another piece of code to fire on the event
when the msg turns to 'read'.

anyone who can help with the code?

On Jan 12, 1:13*am, JP wrote:
One workaround would be to write some VBA code to set the "Do Not
Archive" flag on Read emails, then when you click on FileArchive,
uncheck "Include items with "Do not AutoArchive" checked." so those
emails would not be moved to archive.

HTH,
JP

On Jan 11, 9:16*am, Nabeel wrote:



Hi,


Is there a way to defined AutoArchiving to only archive read emails
older than a certain period?- Hide quoted text -


- Show quoted text -


  #5  
Old January 11th 08, 10:41 PM posted to microsoft.public.outlook
JP[_3_]
external usenet poster
 
Posts: 201
Default Archive only 'Read e-mails'

You may want to post your question in microsoft.*public.*outlook.*
program_vba.

To get you started, you would need to check the ItemChange event for
your Inbox and see if the "Read" property of an email changes. If it
does, set the flag so it won't be archived. This code is a bit crude
so hopefully someone else will be able to refine it for you.

For example:

Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub Items_ItemChange(ByVal Item As Object)
If (Item.Class = olMail) And (Item.UnRead = False) Then
On Error Resume Next
' Msgbox "Setting do not archive flag now"
Item.NoAging = True
On Error Goto 0
End if
End Sub


HTH,
JP

On Jan 11, 4:27*pm, Nabeel wrote:
I think you meant setting the 'Do Not archive' on 'unread emails'
and then there would be another piece of code to fire on the event
when the msg turns to 'read'.

anyone who can help with the code?

On Jan 12, 1:13*am, JP wrote:



One workaround would be to write some VBA code to set the "Do Not
Archive" flag on Read emails, then when you click on FileArchive,
uncheck "Include items with "Do not AutoArchive" checked." so those
emails would not be moved to archive.


HTH,
JP


  #6  
Old January 11th 08, 10:51 PM posted to microsoft.public.outlook
Brian Tillman
external usenet poster
 
Posts: 17,452
Default Archive only 'Read e-mails'

JP wrote:

One workaround would be to write some VBA code to set the "Do Not
Archive" flag on Read emails, then when you click on FileArchive,
uncheck "Include items with "Do not AutoArchive" checked." so those
emails would not be moved to archive.


But he wants to archive the read mail. He doesn't want to archive unread
mail. The VBA code should add the flag to unread items, not read items.
The problem I see with that, though, it that it would be all too esy to
forget to reenable archiving on the items as they become read. He's wind up
with nothing being archived as messages aged.
--
Brian Tillman [MVP-Outlook]

  #7  
Old January 11th 08, 10:51 PM posted to microsoft.public.outlook
JP[_3_]
external usenet poster
 
Posts: 201
Default Archive only 'Read e-mails'

Sorry that should be

Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub Items_ItemChange(ByVal Item As Object)
If (Item.Class = olMail) And (Item.UnRead = False) Then
On Error Resume Next
' Msgbox "Setting do not archive flag now"
Item.NoAging = True
On Error Goto 0
End if
End Sub


On Jan 11, 4:41*pm, JP wrote:
You may want to post your question in microsoft.*public.*outlook.*
program_vba.


  #8  
Old January 12th 08, 03:03 AM posted to microsoft.public.outlook
JP[_3_]
external usenet poster
 
Posts: 201
Default Archive only 'Read e-mails'

Apparently today is my day to repost code over and over! I think
the double negatives are throwing me off. Thank you Brian, here is the
revised (again) code. I do agree with you and suggest something better
to the OP, like posting to the other group (or not leaving emails
unread grin).

But as long as the emails are read from the Inbox, wouldn't it trigger
this code and (eventually) get the msg archived?


Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub Items_ItemChange(ByVal Item As Object)
If (Item.Class = olMail) And (Item.UnRead = False) Then
On Error Resume Next
' Msgbox "Setting do not archive flag now"
Item.NoAging = False
Else
Item.NoAging = True
On Error Goto 0
End if
End Sub


--JP


On Jan 11, 4:51*pm, "Brian Tillman" wrote:

But he wants to archive the read mail. *He doesn't want to archive unread
mail. *The VBA code should add the flag to unread items, not read items.
The problem I see with that, though, it that it would be all too esy to
forget to reenable archiving on the items as they become read. *He's wind up
with nothing being archived as messages aged.
--
Brian Tillman [MVP-Outlook]


  #9  
Old January 12th 08, 11:17 AM posted to microsoft.public.outlook
Nabeel
external usenet poster
 
Posts: 9
Default Archive only 'Read e-mails'

Brian, JP,

Thanks for the code and the suggestion.


On Jan 12, 7:03*am, JP wrote:
Apparently today is my day to repost code over and over! I think
the double negatives are throwing me off. Thank you Brian, here is the
revised (again) code. I do agree with you and suggest something better
to the OP, like posting to the other group (or not leaving emails
unread grin).

But as long as the emails are read from the Inbox, wouldn't it trigger
this code and (eventually) get the msg archived?

Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub Items_ItemChange(ByVal Item As Object)
If (Item.Class = olMail) And (Item.UnRead = False) Then
* *On Error Resume Next
* *' Msgbox "Setting do not archive flag now"
* *Item.NoAging = False
Else
Item.NoAging = True
* *On Error Goto 0
End if
End Sub

--JP

On Jan 11, 4:51*pm, "Brian Tillman" wrote:





But he wants to archive the read mail. *He doesn't want to archive unread
mail. *The VBA code should add the flag to unread items, not read items.
The problem I see with that, though, it that it would be all too esy to
forget to reenable archiving on the items as they become read. *He's wind up
with nothing being archived as messages aged.
--
Brian Tillman [MVP-Outlook]- Hide quoted text -


- Show quoted text -


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
E-mails Being Deleted When Moving From Archive to Inbox Jason H.[_2_] Outlook - General Queries 1 October 1st 07 08:57 PM
cannot read mails in HTML Format Alper Ozgur Outlook - General Queries 1 March 20th 07 12:28 PM
Cannot read e-mails with OE6 Jim Terry Outlook Express 1 December 1st 06 12:44 AM
Can't read e-mails RLM Outlook Express 2 May 9th 06 01:13 AM
e-mails being read as soon as it's downloaded Peter McCaul Outlook - General Queries 1 April 12th 06 05:09 AM


All times are GMT +1. The time now is 09:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.