Stopping the Function Item_Close()

R

Ross

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,
 
S

Sue Mosher [MVP-Outlook]

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
 
R

Ross

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.
 
S

Sue Mosher [MVP-Outlook]

Show your code?

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

Ross

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
 
S

Sue Mosher [MVP-Outlook]

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
 
R

Ross

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top