Reputation: 1
How do I send an e-mail to a custom folder in Outlook?
I want the mail to be placed in the custom folder not in the Inbox folder.
I tried this.
Dim moApp = CreateObject("Outlook.Application")
Dim emailDefaultFolder = moApp.GetNameSpace("MAPI").GetDefaultFolder(6) 'Inbox folder
Dim emailCustomFolder = emailDefaultFolder.Folders("Submission") 'Custom Folder
Dim emailNotif = moApp.CreateItem(0)
With emailNotif
.To = "myemail.mail.net"
.Subject = "This is a test only."
.ReadReceiptRequested = True
.Send()
.Move(emailCustomFolder)
End With
Upvotes: 0
Views: 823
Reputation: 66286
You cannot invoke any properties or methods after calling Send (which is asynchronous). If you want the sent message to be saved in a folder other than the default Sent Items folder, set the MailItem.SaveSentMessageFolde
r property before calling Send
.
Upvotes: 1