Thanks Diane. I've actually tried this macro which seems to work ok except that it shows 0 for the flagged message count so I must have made some mistake in the coding. Any ideas please? Thanks.
Sub How_Many_Flagged_Messages()
Dim objOutlook As Object
Dim objnSpace As Object
Dim objFolder As Object
Dim EmailCount As Integer
Set objOutlook = CreateObject("Outlook.Application")
Set objnSpace = objOutlook.GetNamespace("MAPI")
On Error Resume Next
Set objFolder = objnSpace.Folders("
xxxxx.xxxxx@gmail.com").Folders("Inbox")
If Err.Number <> 0 Then
Err.Clear
MsgBox "No such folder."
Exit Sub
End If
EmailCount = objFolder.Items.Count
Dim FollowupCount As Integer
Dim itms As Object
Set itms = objFolder.Items
Dim FollowupItms As Object
Set FollowupItms = itms.Restrict("[FlagStatus] = 2")
FollowupCount = FollowupItms.Count
Set objFolder = Nothing
Set objnSpace = Nothing
Set objOutlook = Nothing
MsgBox "Number of messages in the folder: " & EmailCount & ", with " & FollowupCount & " flagged for Follow Up", , "Message Count"
End Sub