Hi all - I have a VBA code that automatically sends messages. It's been working for >1 year, however now I am getting below error.
Code (snags on last line):
Apologies for the redundancies and (probably) terrible code structure.
I've checked everything, subfolder name matches exactly to code. Subfolder lies directly under Inbox as it always has. Any ideas?
Thx
Run-time error '-2147221233 (8004010f)':
The attempted operation failed. An object could not be found.
Code (snags on last line):
VBA Code:
Sub SendEmail (i As Long)
Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim FlDr as MAPIFolder
Dim subfldr As Outlook.Folder
Dim olMail As Outlook.MailItem
Dim olReply As Outlook.MailItem
Dim olItems As Outlook.Items
Dim k As Integer
Dim sSubject As String
Dim objDoc As Object
Dim objBkm As Object
Dim OutMail As Object
Dim OutApp As Object
Dim Signature As String
Dim MsgHistory As String
Dim newBody As String
Dim startBody As String
Dim sp, ep As String
Dim T5 As String
Dim pymt As String
Dim rcpt As String
Dim ctp As String
Dim IsOutlookCreated As Boolean
sp = "<p style='font-family:calibri;fontsize:11'>"
ep = "</p>"
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set FlDr = olNs.GetDefaultFOlder(olFolderInbox)
Set subfldr = FlDr.Folders("Subfolder_Name")
Apologies for the redundancies and (probably) terrible code structure.
I've checked everything, subfolder name matches exactly to code. Subfolder lies directly under Inbox as it always has. Any ideas?
Thx