OL98: Custom Forms and Programming Limitations
ID: Q182402
|
The information in this article applies to:
SUMMARY
This article describes known limitations you may encounter when creating
custom forms and programming solutions with Microsoft Outlook 98. Issues
covered include limitations of the object model and other limitations
related to the architectural design of Outlook.
The following topics are covered in this article:
Functionality of the:
- Contact Forms
- Mail Message Forms
- Task Forms
- Appointment Forms
- Journal Entry Forms
- Note Forms
- Office Forms
Other Functionality:- The Calendar Control
- Changing Option Settings
- Modifying Folder Properties
- Setting Views
- Printing
- Modifying the Outlook Bar
- Programming Rules for Incoming Mail
- Posting a File to a Folder
- Changing the Mouse Pointer to an Hourglass
- Storing RTF Information in Message Controls
- Dragging Outlook Items to an OLE Container Control
- Digitally Signing and Encrypting Messages
- Cannot Programmatically Set the Message Control to Read-Only
MORE INFORMATION
The Outlook object model focuses on folders and the Outlook items in
folders, not the program itself. This means that while you can manipulate
forms and folders, many of the commands or settings that are available
through the user interface are not available when programming.
NOTE: You may be able to use the CommandBars collection to work around some
of these object model limitations. For more information about programming
CommandBars, please see the following article in the Microsoft Knowledge
Base:
Q182394
OL98: How to Use Command Bars in Outlook Solutions
When using the Outlook object model, it is important to note that
information is usually sent directly to the form item. This may result in
different behavior compared to when a user enters information through the
user interface. Many of the IntelliSense features are handled at the
program level not the form level. This means that some of these
IntelliSense features do not apply when programmatically modifying forms,
or they may only be applied when an item is saved. For example, if you
programmatically set a contact's e-mail address, the address will not
be resolved until the contact item is saved.
There are also controls and field types whose functionality is directly
incorporated into the program itself and generally not customizable.
These architectural design considerations are the basis for most of the
Outlook programming limitations, and should be taken into account when
designing a solution.
NOTE: The scope of this article is limited to Microsoft Visual Basic
Scripting Edition (VBScript), and may not take into account possible
solutions using the Active Messaging object model or other Microsoft
Exchange-related programming technologies. For more information about
these technologies, please consult information provided by the
Microsoft Developer Network (MSDN) at the following Microsoft Web site:
http://www.microsoft.com/msdn
NOTE: Because the Microsoft Web site is constantly updated, the site
address may change without notice. If this occurs, link to the Microsoft
home page at the following address:
http://www.microsoft.com/
Contact Forms
The General page is the only default page on the Contact form that can be
modified. You can further modify the form by hiding the other default pages
or using the new, blank pages that are available.
If you create a custom form page, you cannot fully recreate the following
default functionality:
- The Birthday and Anniversary fields on the Details page of the form
use a calendar control that is internal to Outlook and cannot be used on
a custom form page.
Mail Message Forms
The Message page is fully modifiable and you can further modify the form by
hiding the Message page or using the new, blank pages that are available.
Task Forms
The Task and Details pages are not modifiable, but you can modify the form
Appointment Forms
You cannot modify the default pages of the form, but you can modify the
form by hiding these pages or using the new, blank pages that are
available.
Journal Entry Forms
You cannot modify the General page of the form, but you can modify the form
by hiding the General page or using the new, blank pages that are
available.
Note Forms
This form cannot be customized, but you can access the fields of Notes in a
folder by using automation and the Outlook object model.
Office Forms
To create an Office Form, on the File menu, point to New and click Office
Document.
You cannot modify the default pages of the form and you cannot add new
pages to the form. You typically customize this type of form by modifying
the embedded Office document.
For more information about programming with Office Forms, please see the
following article in the Microsoft Knowledge Base:
Q182364
OL98: Programmatically Accessing Office Form Documents
The Calendar Control
The Outlook Contact, Appointment, Task and Journal Entry forms contain a
drop down calendar which allows you to select a date by clicking the
desired day on the calendar. This feature is internal to Outlook and you
cannot access it from another program because it is not a separate control.
To see the calendar drop down feature, open a new appointment and click the
arrow to the right of the Start Date or End Date fields. Outlook will
display a small monthly calendar where you can click to select a date.
Changing Option Settings
There is no way to programmatically change any of the program-level
settings in Outlook, since they are not exposed by the object model.
Examples are any of the settings in the Options dialog box on the Tools
menu.
Modifying Folder Properties
The Outlook object model does not expose folder properties, such as the
default form to use for the folder, synchronization settings, or
AutoArchive settings.
Setting Views
There is no way to programmatically set or configure views, which includes
all of the features listed under the View menu. These options are not
exposed by the Outlook object model.
Printing
The PrintOut method is the only way to programmatically print an Outlook
item, or form. There is no way to programmatically alter the way a form
prints. As a workaround, you can create a custom template in Word and use
automation code to transfer the information from Outlook to Word and then
have Word print out the template. You can start this process by placing a
button on the Outlook form and use the Click event for the CommandButton to
start the VBScript code to automate Word.
Modifying the Outlook Bar
There is no way to programmatically add folders or items to the Outlook
Bar. All changes must be made through the user interface.
Programming Rules for Incoming Mail
Because all VBScript code is stored within individual Outlook items such
as messages or contacts, there is no simple way to execute code (fire an
event) when mail enters the Inbox. The Rules Wizard does not provide this
functionality.
To work around this limitation, you can set up a rule using the Rules
Wizard to forward all relevant messages to an "unprocessed" folder. Then
create a Microsoft Visual Basic application that automates Outlook at
regular intervals; the application would batch-process the items in the
folder and then move or delete them as appropriate.
Modifications to the Post Form
If you edit or otherwise modify the Post form, and save the changes to the
folder without publishing the altered form, your changes will not be
preserved when you re-open the form. This allows the Post form to be used
in a one-off fashion.
Posting a File to a Folder
There is no way to post a file as opposed to an Outlook item, such as a
contact, appointment, task, and such, to a folder using VBScript or the
Outlook object model.
Microsoft Word 97 and Microsoft Excel 97 do support a Post method if you
want to post a Word document or Microsoft Excel workbook, but there is no
direct way to specify a folder from within those programs. The Post method
in these programs will display a dialog box prompting the user for a
folder.
Changing the Mouse Pointer to an Hourglass
You cannot control the appearance of the mouse pointer from VBScript. If
you are writing VBScript code that takes some time to process, you cannot
force Outlook to display an hourglass pointer if Outlook does not do so
automatically.
Storing RTF Information in Message Controls
Each Outlook item can only have one message (or notes) control to store
Rich Text Format (RTF) information, including attachments. It is possible
to add more than one control per form, but the controls will all be bound
to the same field, so they will display the same information.
Dragging Outlook Items to an OLE Container Control
You can use an OLE container control on a Visual Basic form to hold objects
that are dragged onto it. When Outlook items are dragged onto these
controls, Outlook exposes a few fields, but there is no way to change
which fields are exposed.
Digitally Signing and Encrypting Messages
There is no way to digitally sign or encrypt a mail message using Outlook's
Object model.
Messaging Application Programming Interface (MAPI) mail messages have a
PR_Security property that supports digital signing and encryption. While
you can set this property using the Collaborative Data Objects (CDO) object
model, current Microsoft MAPI transports to not support this property.
Cannot Programmatically Set the Message Control to Read-Only
When a form is in design mode, you can right-click the Message, or Notes,
control and then click Properties and set the control to read-only.
However, changing the read-only status of the control from VBScript will
not have an effect.
REFERENCES
For more information about creating solutions with Microsoft Outlook 98,
please see the following articles in the Microsoft Knowledge Base:
Q180826
OL98: Resources for Custom Forms and Programming
Q182349
OL98: Questions About Custom Forms and Outlook Solutions
Additional query words:
OutSol OutSol98 drag drop drag-and-drop simulate
Keywords : FmsProb ScriptHowTo
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: July 26, 1999