Alternative to item.close

F

flaterp

I have an Outlook form where users input contact information. Within the form
I created a "Done" button that calls item.close (0). So the form saves
automatically and closes. However, the "Done" button no longer works. Users
must manually close the form by clicking the X and selecting yes to save any
changes. From what I've read elsewhere on this problem, the recent upgrade to
Office 2007 is the cause of the problem. Thankfully Outlook doesn't crash;
it's just unresponsive to clicking the Done button.

I see there is a hotfix out, but that would require installation on all
users' PCs. Is there a code workaround that would perform a similar save then
close sequence? I have seen item.save mentioned elsewhere, but I'm not sure
how to implement with the close. Thanks in advance for any help.
 
K

Ken Slovak - [MVP - Outlook]

item.Save() is just going to save the item, it won't close it.

item.Close() or Inspector.Close() won't work when called inside the
item.Close() or Inspector.Close() event handlers but should work if called
from a button click event handler.
 
F

flaterp

Ken, thanks for the quick response. But please excuse my programming
ignorance. It's not clear to me the distinction between an event handler and
a button click event handler. I would assume that I have set up the latter
case. While designing the form, I click "view code". This launches the
"script editor". The only code within the script editor is:

Function DoneButton_Click
Item.Close(0)
End Function

Obviously the name of "Done" button on the form is DoneButton.

I upgraded to Office 2007 about 6 months ago, but only ran into this
item.close problem within the last 10 days. So I'm not certain about the
cause of the problem.

Thanks again for your help.
 
K

Ken Slovak - [MVP - Outlook]

Your code is executing inside a custom button Click event handler, so it
should be OK. If the code worked before I'd be checking to see what changed,
I don't have that problem here in any of my Outlook 2007 setups if I call
Item.Close in form code.
 

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