You need to insert the path to the folder e.g. as here by looping through the various stores available
Public Sub NewInbox_Su()
'Graham Mayor - https://www.gmayor.com - Last updated - 04 Jan 2021
Dim myNameSpace As Outlook.NameSpace
Dim oStore As Outlook.Store
Dim myInbox As Outlook.Folder
Dim myItem As MailItem
Dim lngCount As Long
Set myNameSpace = Application.GetNamespace("MAPI")
For Each oStore In myNameSpace.Stores
If oStore.DisplayName = "Account Display Name" Then 'insert the account display name here
Set myInbox = oStore.GetRootFolder.folders("Inbox")
MsgBox myInbox.UnReadItemCount
If myInbox.UnReadItemCount > 0 Then
For lngCount = myInbox.items.Count To 1 Step -1
If TypeName(myInbox.items(lngCount)) = "MailItem" Then
If myInbox.items(lngCount).UnRead = True Then
Set myItem = myInbox.items(lngCount)
If InStr(LCase(myItem.Body), "alarm") > 0 Or _
InStr(LCase(myItem.Subject), "urgent") > 0 Then
myItem.Categories = "Blue Category"
myItem.Save
myItem.UnRead = False
End If
End If
End If
DoEvents
Next lngCount
End If
Exit For
End If
Next oStore
Set oStore = Nothing
Set myNameSpace = Nothing
Set myInbox = Nothing
Set myItem = Nothing
End Sub