Changing the Send options

W

Wanda

Sent messages are important for tracking issues in our
department. We know you can set rules, but the correct
rules do not always apply. We want a pop-up to allow us
to select a folder to put a copy of our sent message to,
instead of it automatically going to the sent folder. Is
this possible? Not sure where to start on this one.
Thanks.

Wanda
 
R

Ralph Hodenius [MS]

Hi Wanda,

Here is a small sample that lets you select the inbox or the sent items
folder to save a copy.

1) Insert a userform

2) Add a combobox to the form

3) Add a command button to the form

4) Double click on the command button

5) Copy the following code in the command button function:
Private Sub CommandButton1_Click()
UserForm1.Hide
End Sub

6) In the code section for ThisoutlookSession, copy the following code:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim ns As NameSpace
Dim fi, fs As MAPIFolder

Set ns = Item.Application.GetNamespace("MAPI")
Set fi = ns.GetDefaultFolder(olFolderInbox)
Set fs = ns.GetDefaultFolder(olFolderSentMail)

'Fill the combobox on the userform with mailbox folders
UserForm1.ComboBox1.Clear
UserForm1.ComboBox1.AddItem fi.Name, 0
UserForm1.ComboBox1.AddItem fs.Name, 1

'Set the first item visible in the combobox
UserForm1.ComboBox1.ListIndex = 0

'Set the caption of the command button
UserForm1.CommandButton1.Caption = "Save in this Folder"

'Show the form
UserForm1.Show

Select Case UserForm1.ComboBox1.Value
Case fi.Name
Set Item.SaveSentMessageFolder = fi
Case fs.Name
Set Item.SaveSentMessageFolder = fs
End Select
End Sub

7) Sent a new message and you'll see that you can select the folder where a
copy of the message can be saved.



Regards,

Ralphho
Microsoft
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top