Hello,
I have the below codes that worked in 2010 outlook (sending all drafts in the draft folder). but it stopped working in 2016, I got error message saying Outlook doesn't recognize one or more names and the yellow line is highlighted on "oFolder.Items(1).Send"
PHP Code:
Sub Send()
Dim oFolder As Folder
Dim oNS As NameSpace
Dim olMail As MailItem
Set oNS = Outlook.Application.GetNamespace("MAPI")
Set oFolder = oNS.GetDefaultFolder(olFolderDrafts)
For i = 1 To oFolder.Items.Count
oFolder.Items(1).Send
Next
Set oNS = Nothing
End Sub
can someone please let me know how to fix it?
thanks!
Bookmarks