How to close active-form and open a new one

  • Thread starter Thread starter Boein
  • Start date Start date
B

Boein

Hi,

using outlook 2003. I have a form, I want to open a new form from this form
and close to first form. I need sth like me.activeform.close () but it
doesn't seem to work that way in OL2003. Anybody idea's

THanks
 
To close a custom form, call the item's Close method. To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")
newItem.Display

If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.
 
HI Sue,

Thanks for the info but how do I make a reference to that item to use the
close method on it.
 
In what context? VBScript code behind the current item uses the intrinsic Item object to refer to the item.

From other code, the currently open item is returned by Application.ActiveInspector.CurrentItem. If you have the Inspector, it also has a Close method.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
Back
Top