Stopping the Function Item_Close()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a custom form that posts to a public folder. When the user clicks Post
the Function Item Close() is executed. I am doing some conditional checks in
this function and need to possibly stop the posting and closing of the form.
How would I do that within that function?
Thanks,
 
Set the value of the function to False:

Function Item_Close()
If <your criteria are not met> Then
Item_Close = False
End If
End Function
 
Thanks Sue,

I tried that previously and again today but it seems to ignore it.

I can see the public folder in the background and as soon as I click Post
the item is posted. My form is still open at that point because I have a
MsgBox displaying some information.
 
Show your code?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
This code is in a Message class IPM.Post.Form25 and when the CheckBox is
checked I can not "Close" the form window but I can click on "Post" and it is
posted to the public folder then closed. I need the "Post" & Close to be
prevented just like closing the window is prevented.
Thanks for your help.

Function Item_Close()
' "AmIChecked" is a Check Box
Dim bCheck
bCheck = Item.UserProperties.Find("AmIChecked")
If bCheck Then
Item_Close = False
End If
End Function
 
Clicking Post fires the Write event. You'll need to put validation in Item_Write as well.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Thanks Sue, that's what I needed.

Sue Mosher said:
Clicking Post fires the Write event. You'll need to put validation in Item_Write as well.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top