marben_08
marben_08

Reputation: 1

How to place an e-mail, sent to myself, into a folder other than the inbox?

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

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

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.SaveSentMessageFolder property before calling Send.

Upvotes: 1

Related Questions