Change default "Save Sent Item To" folder

Charalambos

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hello all and best wishes for a happy new year!

While searching for a solution to "problem" that we have, I came across your VB codes here.
We are interested in the first solution from the above topic:
If you always want to use a different folder, you can use a macro to set the Save message to folder.

Setup:
We are using Office 365 email accounts along with the desktop version of Outlook 2016 32bit (16.0.4591.1000) on Windows 10 machines.
We want to apply a solution similar to the link above to users who have three email accounts setup to their Outlook. One main email address e.g. user@companya.com and two shared email accounts e.g. user@companyb.com and user@companyc.com

What we want is, the sent emails from @companyb.com and @companyc.com to be saved in the "Sent Items" folder of @companya.com.

Can the VB code below modified to suit our needs?
Code:
Private Sub Application_ItemSend(ByVal Item As Object)
  Dim objNS As NameSpace
  Dim objFolder As MAPIFolder
  Set objNS = Application.GetNamespace("MAPI")
  Set objFolder = objNS.GetDefaultFolder(olFolderSentMail).Folders("Diane")
  Set Item.SaveSentMessageFolder = objFolder
  Set objFolder = Nothing
  Set objNS = Nothing
End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
It should work as it will apply to all sent messages. If you don't want his to go there too, use an if statement to only apply it to some mail.

This filters to a subfolder of the default account's sent folder:
Set objFolder = objNS.GetDefaultFolder(olFolderSentMail).Folders("Diane")
If you want all in his sent folder, use
Set objFolder = objNS.GetDefaultFolder(olFolderSentMail)
or to use a folder at the same level as inbox, sent etc, use
Set objFolder = objNS.GetDefaultFolder(olFolderSentMail).parent.Folders("Diane")

Are the mailboxes added as Accounts (listed in file, account settings) or added as shared mailboxes? (Either 'automapped' to the user's account and show up when he creates a profile or added as an Additional mailbox in Account Settings, Change Account, More options).

If its a shared mailbox, sent items should go into the his sent items automatically, or into both mailboxes if the admin changed a setting. If the reg key was set to control where they went, remove it.
Save Sent Items in Shared Mailbox Sent Items folder
 

Charalambos

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hello Diane and thank you for your response.

The mailboxes are added as separated accounts. Under account settings, you can see three different entries. One for each mailbox. The users want ALL their sent emails to be stored in the "main's email account" Sent Items folder.

So if we use this code you listed:
Set objFolder = objNS.GetDefaultFolder(olFolderSentMail)​
all sent emails would be placed in Sent Items folder of the main email address (@companya.com)?
For example, if an email is sent from user@companyb.com the sent email will be saved in the Sent Items folder of the @companya.com mailbox?

Hope I didn't confuse you! :)
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
They should be put in that - but i haven't tested it to confirm.
 

Charalambos

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Hello again Diane.
I tried the code above but it gives me an error every time I'm sending an email.
it sends the email just fine, but it always gives an error (please see attached screenshot) and saves the sent emails to the default Sent Items folder of each mailbox.
 

Attachments

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
i am getting that error too - i haven't had a lot of time to figure out why though. (and thought maybe it was because i used one exchange and one pop and the pop account wouldn't have permission to the exchange mailbox).
 

Charalambos

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I will try some of the other options available in this thread and I will report back!
From your experience, is there any software/add-on that can do what we are looking for?
Thank you!
 

Charalambos

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
* I can't edit my previous post, so I'm writing a new one! *

I tried two of the other options from this topic and they work.
Use VBA to display a dialog: Works on all three accounts in Outlook. However, if you click cancel when the dialog appears the Outlook freezes and have to force close the software.
Using Rules to file Sent items (+VBA): Works fine on all accounts in Outlook. The only downside (not-really) is that the sent emails are now in two folders (when sending from a shared mailbox), one in the shared mailbox Sent Items and one in the folder we choose in the rule.

Using the second option will work for us! (changing the default folder would be the optimum solution!)

Do you have any software/add-on that might do this as well?

Thank you very much for your time!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
However, if you click cancel when the dialog appears the Outlook freezes and have to force close the software.
Sounds like the macro isn't properly handling the cancel.

I'm not aware of any addins that can handle the sent messages.
 

Charalambos

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
We will use the other method then until we find something "better".
Thank you very much for your time and your help!
 

Top