This page has been archived and is no longer  being actively maintained.
Outlook Developer Home
Outlook Programmer's Library
 
Outlook Technologies
Outlook Forms
Languages
Samples
Other Technologies

 

Customizing Microsoft Outlook Message Forms

Here are some of the oddities related to customized message forms in Outlook. If you are aware of these from the beginning, you'll spend less time beating your head against the wall. 

Quirks | Limitations | Samples | More Information

Quirks

Message forms default to separate layouts for composing and reading. Many people find their first message form doesn't look right when they receive an item created with it. That's simply because they forgot to customize the Read page! (The other chief cause of message forms looking odd is not sending them in rich-text format; see To send a form via the Internet.)

On items created with customized message forms, the icon does not change to an open envelope after the user opens the message or marks it as read. However, unread messages will still show as bold in a folder view, regardless of what form they use. This is a user education issue as much as anything else. 

The View | Bcc command is not available on the menu for custom forms. If you included a To button on the form, users can click that if they need to add a Bcc recipient.

Custom message forms do not display the "InfoBar" that tells when a message was forwarded or replied to. See OL2002 Information Bar Does Not Display on Custom Mail Form.

If you forward an item created with a custom form, the resulting message uses the same custom form, even if you have IPM.Note for the form listed for the Forward action on the (Actions) tab. In order to avoid one-offing, you should set the form for the Forward action to the same message class as your custom form.

An unsent message item always defaults to saving in the Drafts folder in Outlook 98 and Outlook 2000, even if you use the Items.Add method to create the item in a specific folder. (See To add a toolbar button to launch an Outlook 2000 form for sample code.) If you don't need to send the message item (see Limitations below), just save it and then move it.

Even if you have an AutoSignature set, when you create a new message using a custom form, it does not insert the signature automatically. See Launch custom form message with default signature for a code sample that shows how to use a normal message to get the signature to insert into a new HTML message that uses a custom form. On the other hand, if you designed a form from a message with a signature in it, you should be able to remove the signature by running the form, deleting the signature, then republishing the form. For Outlook 2002, a post-SP2 hotfix causes the automatic signature to work on custom forms; see Outlook 2002 Post-Service Pack 2 Hotfix Package September 19, 2003.

If you set the Body property on a message item in Outlook 2000 or earlier versions, you are also changing the format to rich-text. (The VBA Help file says that setting the Body changes the format to the user's default. This is not correct.) One workaround is to CDO to set the body with the Message.Text property. If you set the HTMLBody property, you set the format to HTML. Outlook 2002 provides a BodyFormat property for directly setting the message type; setting the Body property in Outlook 2002 defaults the format to the user's default choice in Tools | Options | Mail Format.

A published message form does not retain any value you put in the From field, although a form saved as an .oft template file does. A possible workaround is to use this code in your form to set the From value. (Note that this is not the same as designating a sending account for the item, which is not possible.)

Also see:

Back to Top

Limitations

You cannot make the message form the default for a folder. See OL2000: How to Set Any Form as Default for a Folder for a workaround that uses a custom Post form, set as the folder default, to launch the message form. See Quirks above for a related quirk about saving messages in a specific folder.

I have not figured out any way in message form code to send the message and save it outside the user's default information store, except by putting a public folder's address in the Cc or Bcc field. (If you want to save to a folder in the default store, you can set the SaveSentMessageFolder property.) The workaround is to use a VBA/VB event handler to monitor the Sent Items folder for new items with the MAPIFolder.Items.AddItem event.

Outlook provides a SenderName property on the MailItem object, but no property for the sender's address, except in Outlook 2003 or later. For sample code, see To get the sender's address from a Microsoft Outlook mail message.

Microsoft says you shouldn't expect security features like digital signatures to work with custom forms. See Q279106 - OL2000 Do Not Use Message Security Features with Custom Forms.

You cannot set the sending account for a message directly. It is possibly, however, to do some interesting things with CommandBars. See Listing 21.9 in the sample code for my Microsoft Outlook Programming book.

Back to Top

Samples

AddHeader Form and AddHeader3 Form  Two samples that demonstrate how can you add an X-header in your outgoing Internet messages using CDO. 
Bulk Reply Form   Creates a single message in reply to all messages in a particular folder
Internet Headers Sample Form Sample form by Outlook MVP Ken Slovak that demonstrates how to use CDO to retrieve the Internet headers of a received message
Routed Message Form Demonstrates how to set up a message to route to several recipients. 
Survey Form Generic form to conduct surveys using different types of questions, returning responses in Q&A and comma-delimited format. 
Using Microsoft Outlook to Schedule Report Transmissions A message form that sends itself, ideal for scheduling repetitive transmissions.
Back to Top

More Information

   
© 2002-6 TurtleFlock, LLC
All right reserved.
About OutlookCode.com

Send comments to webmaster@outlookcode.com

Designed and Implemented by TerraLink USA 

FrontPage Integration
by RobsonDesignWorks

 
 
get Sue's code | forums | share your own code | registration