Guys, I have cobbled together the below code to move emails from one folder to an archive folder. It seems to be identifying the from folder and the move to folder but it is erroring out. Run-Time Error '91: Object variable or With block variable not set (in Red below)
Any suggestions would be appreciated.
Thank You
VBA Code:
Sub MoveDraftMail()
Dim objOutlook As Outlook.Application
Dim objNamespace As Outlook.NameSpace
Dim objSourceFolder As Outlook.MAPIFolder
Dim objDestFolder As Outlook.MAPIFolder
Dim objItem As MailItem
Dim Archive_Folder As Outlook.MAPIFolder
Set objOutlook = New Outlook.Application
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objSourceFolder = objNamespace.Folders(10).Folders("HouseBillofLadingReport")
Set Archive_Folder = objNamespace.Folders("Online Archive - My@email").Folders("Personal_Folders").Folders("2021").Folders("InBox")
[COLOR=rgb(184, 49, 47)]ObjItem.Move Archive_Folder[/COLOR]
Set objDestFolder = Nothing
End Sub
Any suggestions would be appreciated.
Thank You