The following is a bit of VB Script which is supposed to extract the password from an Outlook form.
When I run it as a Macro under Outlook I get the following error message: ARGUMENT NOT OPTIONAL
I'm no programmer so any help would be nice
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
When I run it as a Macro under Outlook I get the following error message: ARGUMENT NOT OPTIONAL
I'm no programmer so any help would be nice
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