Outlook Developer Home
Outlook Programmer's Library
 
Outlook Technologies
Outlook Forms
Languages
Samples
Other Technologies

 

 

To recover the password for an Outlook form

Getting the password for an Outlook form is an almost trivial exercise in most cases, because the FormDescription object, which contains key information about the form, includes a Password property. The Outlook VBA code below pops up the value of the Password property in a message box. Before running it, open an item that uses the custom form. You can either open an existing item or use the File, New, Choose Form command to create a new item using the custom form. You can then press Alt+F8 to display the Macros dialog box and choose the GetFormPassword macro.

Code Sample

Notes

After you retrieve the password with this macro, you may want to open the form in design mode entering the password in the prompt that appears and remove the password protection completely. On the (Properties) page, clear the Protect form design box to remove the password protection. You can also set a new password with the Set Password button.

If you don't have Outlook 2000 or later, you can use this code in a Visual Basic or a VBA project in Word. Just remember to add a reference to the Outlook library.

If the password was entered with non-printing characters, the MsgBox will show a number of squares like this          instead of the password text. You can still retrieve the password with this additional code:

        strPassword = objFD.Password
        intLen = Len(strPassword)
        For i = 1 To intLen
            Debug.Print Asc(Mid(strPassword, i, 1))
        Next

You might need to use SendKeys to enter such non-printing characters in the form's password dialog.

To set a password that's more secure, you can set up Office to support an additional non-ASCII language, such as Russian. Enter the password with the other language turned on. If the password is entered in that fashion, both the code samples above will return only ???? for a four-character password. You will, of course, need to switch to that other language before entering the password to get into form design mode.

As you may have gathered from this article, the form password protection in Outlook doesn't amount to much. It's hardly surprising, then, that Microsoft has removed form password support in Outlook 2007.

More Information

   
2002-7 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