Sub GetFormPassword()
Dim objApp As Application
Dim objInsp As Inspector
Dim objFD As
FormDescription
Set objApp = CreateObject("Outlook.Application")
Set objInsp = objApp.ActiveInspector
If Not objInsp Is Nothing Then
Set objFD = objInsp.CurrentItem.FormDescription
MsgBox Prompt:="The password for the " & Chr(34) &
objFD.MessageClass & Chr(34) & " form is:" & _
vbCrLf & vbCrLf & objFD.Password, Title:="Get Form Password"
Else
MsgBox Prompt:="Please open an item using " & "the desired form
before you " & _
"run the GetFormPassword macro.", Title:="Get Form Password"
End If
Set objFD = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Sub