LDD Today

Tips from LDD

Adding an autosave feature to your Notes mail file


Tip submitted by
Andre Guirard

Level: Intermediate
Works with: Notes/Domino
Updated: 04-Aug-2003

Have you ever wanted an "autosave" feature in Notes mail, so you don't lose your magnum opus memo in a crash (or via fumbling fingers)? You can customize your mail file to save a draft at an interval you specify.

Open your mail database in Domino Designer and open the Script Library view. Select CoreEmailClasses, then choose Design - Design Properties. The CoreEmailClasses script library is the library in which Lotus intends customization of the Notes memo event code. In the Design Document Properties box, select the Design tab, and enable "Prohibit design refresh or replace to modify."

Next, double-click the script library. In the Declarations section, add the following code:

' (Declarations)
Dim autosaveTimer As Variant
Dim autosaveUidoc As Variant
Dim autosaveInterval As Double

Sub AutosaveInit(Source As NotesUIDocument)
End Sub

Sub AutosaveNow(Source As NotesTimer)
oops: End Sub

In the PostOpenExtension subroutine, just before the line "PostOpenExtension = True", insert the following call:

To control autosave from the Preferences dialog box in Notes mail, change the (Calendar Profile) form. In Domino Designer, open the Forms view, select the (Calendar Profile) form, and enable the Prohibit design refresh option as before. Then add the Autosave tab as shown below. Follow these steps:
(Calendar Profile) form

The two fields are defined as follows:
After you add the tab, save and close the form. To enable autosave, open your mail database. Click Tools on the action bar and select Preferences. In the Preferences dialog box, select Autosave.

Note: if you upgrade to a new version of the Notes mail file design, you need to manually merge your changes with any updates Lotus has made.


SUBMIT YOUR TIPS!
We encourage you to send us your tips (You can also click the "Would you like to submit a tip?" graphic below.) Your tips can be anything you've discovered about any Lotus product. The most important thing is that your tip be interesting, useful, or handy. And be sure to include complete information about how your tip works. For ideas, take a look at our tip archives. If we publish your tip, we'll send you the IBM Redbooks Lotus Collection on CD.