PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Macro to Mark Messages As Read

Reply

Macro to Mark Messages As Read

 
Thread Tools Rate Thread
Old 19-09-2003, 10:31 PM   #1
SP
Guest
 
Posts: n/a
Default Macro to Mark Messages As Read


This Damsel is Perplexed - A macro that when activated, will mark messages
as read. Using Outlook 2000, with the security setting as Medium. The
messages are sent via a Rule, utilizing Rules Wizard, the user has an email
with specific Text in the subject line, a copy is sent to a specific folder.
When they are sent to this folder it will mark the messages as unread. Is
there anyway to automate this so it happens automatically without using a
button.
Here is the code created for the automation:

private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

run macro = prjMarkAsRead.mcrMarkAsRead

End Sub




  Reply With Quote
Old 27-09-2003, 12:02 AM   #2
Woody
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read


private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)

run macro = prjMarkAsRead.mcrMarkAsRead

-----------------------------------------------------------
in this outlook session
------------------------------------------------------------
Option Explicit

'set up outlook references
Dim outNameSpace As NameSpace

Public WithEvents OutItems As Outlook.Items

Private Sub outItems_ItemAdd(ByVal Item As Object)
On Error Resume Next

DoEvents
'make sure mail item in folder
If TypeName(Item) = "MailItem" Then
'set to read
With Item
.UnRead = false
.Save
End With

end sub
------------------------------------------------------------

rough draft but should be close

Woody
I am not responsible for anything you may see with my name attached to
it, i think.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  Reply With Quote
Old 11-10-2003, 09:05 PM   #3
Philip Brown
Guest
 
Posts: n/a
Default Macro to Mark Messages As Read

Hi, Sue,
I want to mark any message placed in my "Junk E-Mail"
folder as read. How do I do it?
I can't find anywhere on this newsgroup where this
question has been answered. Could you perhaps provide
that answer?

Thanks!

Philip Brown
  Reply With Quote
Old 10-11-2003, 05:46 PM   #4
s0lar1s8
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read

Sub MarkRead()
'coded in outlook 2002
'some code taken from other usergroups, fyi
Dim app As New Outlook.Application
Dim ns As NameSpace
Set ns = app.GetNamespace("MAPI")
'Debug.Print ns.CurrentUser.Name
FindtoMark ns.Folders, 0
End Sub

Sub FindtoMark(parent As Folders, depth As Integer)
Dim flr As MAPIFolder
Dim s As String
s = String(depth * 2, " ")
For Each flr In parent
'Debug.Print s; flr.Name; ": "; flr.DefaultMessageClass;

'mark all as read in a particular folder.
If flr.Name = "Your folder name" Then
For Each objMailItem In flr.Items
'If objMailItem.SenderName = "Spammer Name" Then

If objMailItem.UnRead = True Then
objMailItem.UnRead = False
End If
'End If
Next
End If
ListFolder flr.Folders, depth + 1
DoEvents
Next flr

End Sub



------------------------------------------------
~~ Message posted from http://www.OutlookForum.com/
~~ View and post usenet messages directly from http://www.OutlookForum.com/

  Reply With Quote
Old 11-02-2004, 08:33 PM   #5
docfknx
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read


This is GREAT! Now how do you get it to auto-run everytime you get mail?
Or get mail in the specified folder?

Thanks!

Doc


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  Reply With Quote
Old 11-02-2004, 09:38 PM   #6
docfknx
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read


Actually it's simpler than I thought:

Sub Application_NewMail()
MarkRead
End Sub

Thanks again!

Doc


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  Reply With Quote
Old 18-02-2004, 09:04 PM   #7
s0lar1s8
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read


Welcome

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  Reply With Quote
Old 02-03-2004, 04:18 PM   #8
rpfields
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read


Hi!

I am new to VBA Macros. I'd like to implement this in my Outlook 2000
I have no idea how to do so? Could anyone give me step by ste
instructions. Thank you!

Rega

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  Reply With Quote
Old 02-03-2004, 05:13 PM   #9
TurboBeagle
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read


(1) On your menu bar, go to tool...macros
(2) In the text box for macro name, type in "MarkRead" (without th
quotation marks.)
(3) Push the "create" button
(4) Paste the code from above straight into the vba editor.
(5) Type in the folder name from "Your Folder Name" to whatever th
real name of the folder is.

fyi, you can access multiple folders in the same module with the code

If flr.Name = "Your Folder Name" Or flr.Name = "Your Second Folde
Name" or flr.Name = "Your Third Folder Name" The

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  Reply With Quote
Old 02-03-2004, 05:16 PM   #10
rpfields
Guest
 
Posts: n/a
Default Re: Macro to Mark Messages As Read


Terrific!!!!!!! Thanks!!!!!!!

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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