If you want to mark all mails as read in your outlook Inbox.
Here is the code -
Sub mark_all_unread_mails_as_read_in_inbox_excluding_subfolders()
'TOOLS ->Refrence -> microsoft outlook
'declare outlook objects
Dim olapp As Outlook.Application
Dim olappns As Outlook.Namespace
Dim oinbox As Outlook.Folder
Dim oitem As Outlook.MailItem
'set outlook objects
Set olapp = New Outlook.Application
Set olappns = olapp.GetNamespace("MAPI")
Set oinbox = olappns.GetDefaultFolder(olFolderInbox)
If oinbox.Items.Restrict("[UnRead] = True").Count = 0 Then
MsgBox "NO Unread Email In Inbox"
Exit Sub
End If
Do Until oinbox.Items.Restrict("[UnRead] = True").Count = 0
For Each oitem In oinbox.Items.Restrict("[UnRead] = True")
oitem.UnRead = False
Next
Loop
End Sub
Subscribe to:
Post Comments (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
-
If you want to create the sales funnel in Excel. Snapshot below- Download the sample workbook and go through the steps mentioned in ...
-
If you want to add a new pop up button on mouse right click menu and as soon as you click on it . It shows you multiple buttons with macro a...
No comments:
Post a Comment