Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Close The current Main Item After Hitting a command on a custom form

Outlook 2010
vbscript  
custom form
Command Button

I'm sending users a Custom Form email.
With a command button on the form.

After the command button,
Everything is working ok.
Except after the last message box. I want the MailItem to close.

I'm getting the message ok.
MsgBox " The item was saved."

Just not closing the current email.





 Set myItem = Application.ActiveInspector.CurrentItem
      If Not myItem.Saved Then
          myItem.Save
              MsgBox " The item was saved."
          myItem.close
      End If

Set myItem = Nothing
ASKER CERTIFIED SOLUTION
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Fordraiders

ASKER

sorry, thought i clicked !!
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

you're welcome, brett ~ happy to help

... have a happy thanks-giving ~