Change default action for new mail

  • Thread starter Thread starter Graham
  • Start date Start date
G

Graham

Hi,

Is it possible change change the default form used for the
Standard Outlook toolbar when you click on "New" to create
a new mail.

My company are keen for everyone to use a slightly
different email form which has custom text (shown as a
label) before the subject box, and when the email is sent,
the custom text will be stuck on the front of the email
subject. This is possible via a custom form, however, the
requirement is for everyone to use this by clicking on
the "New" mail button on the toolbar.

Outlook 2000, Exchange 2000

Regards
Graham
 
Graham-

Yes, this can be done. First, create the new form.
[ If you've alraedy done this, you can skip this
paragraph.] Do this by clicking on NEW to open a blank e-
mail, then choose TOOLS | FORM | DESIGN THIS FORM from
the Tools menu. Design the form to your needs, then
PUBLISH the form: TOOLS | FORMS | PUBLISH FORM, or just
click on the icon at the top left of the Toolbar- the one
that looks like a floppy disk with a blue triangle and a
ruler in front of it. Make a note of the name you Publish
the form under.

You'll want to publish the form to a folder that
everyone has access to - if you're running Exchange
Server, that would be the Organizational Forms Library.
Your Administrator must set the permissions to allow you
to publish there. If you're not using Exchange, publish to
any folder that everyone has access to. See this MSDN
article for more: http://msdn.microsoft.com/library/en-
us/dnout2k2/html/odc_olcustfrm1.asp?
frame=true#odc_olcustfrm1_saving
(that's all one line, no spaces)

You can then close the form, but when Outlook prompts
you to Save the form, DO NOT save it. I know this seems
counter-intuitive, but you don't want to save it- you
already did in the Publishing step.

Next, you'll need to tell Outlook to use this form
for all new e-mails. Right click on the Inbox folder, and
left click on PROPERTIES. In the form that pops up, click
the drop-down list (combobox) next to WHEN POSTING TO THIS
FOLDER, USE, and left click on FORMS. In the form that
comes up, select the form you just Published. Click OPEN,
then OK.

If you only need to use this new form for new e-
mails, you're done- but you need to tell Outlook to use
the published form on *ALL* PCs that need to use the new
form.

If you need existing e-mails to open in the new form,
you need to change the .MessageClass for all the existing
e-mails. You need to do this using VBA code or a COM add-
in (see Sue Mosher's website for info on COM Add-ins:
http://www.outlookcode.com/d/comaddins.htm )

You can use code like this:

[ NOTE: I adapted this from code to change the form for
all Contacts; I haven't tested it for E-mails, so BE
WARNED! ;-)

Also, make sure you change NEW_FORM to the name of your
new form in the line:
strNew = "IPM.MailItem.NEW_FORM"
]

'*************************************************

Dim appOl As Outlook.Application
Dim nmsNS As NameSpace
Dim strNew As String
Dim fldInbox As MAPIFolder
Dim itmItems As Items
Dim itmEmail As Object

'change NEW_FORM to the name of your new form:
strNew = "IPM.MailItem.NEW_FORM"

'Declare itmEmail as Object and check the value of the
MessageClass property


Set appOl = CreateObject("Outlook.Application")
Set nmsNS = appOl.GetNamespace("MAPI")
Set fldInbox = nmsNS.GetDefaultFolder(olFolderInbox)
Set itmItems = fldInbox.Items

'Loop through items in the folder:
For Each itmEmail In itmItems
With itmEmail
' Message class needs to be changed - ?
If .Class = olMail Then
If .MessageClass <> strNew Then
' Change the message class:
.MessageClass = strNew
' Save it
.Save
End If
End If
End With
If Err.Number <> 0 Then
MsgBox Err.Number & " " & Err.Description &
vbCrLf & _
"Sender: " & itmEmail.SenderName & " " & _
"Subject: " & itmEmail.Subject
End If
Next

If Err.Number = 0 Then
MsgBox "All done."
Else
MsgBox Err.Number & " " & Err.Description
End If
'**********************************************
Also, note that this code only changes e-mail messages
that are in the Inbox- not in any sub-folders. If your
users have sub-folders or other e-mail folders, you will
have to get them using recursion or by walking the Folder
heirarchy. Or an easier, way, if you know the Folder name,
from Sue Mosher's website:
http://www.outlookcode.com/d/code/getfolder.htm

Also see this MSKB article on referencing Items & Folders:
http://support.microsoft.com/?kbid=208520

HTH,

-Andrew
===================================================
 
Back
Top