How to close active-form and open a new one

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
 
S

Sue Mosher [MVP-Outlook]

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

Boein

HI Sue,

Thanks for the info but how do I make a reference to that item to use the
close method on it.
 
S

Sue Mosher [MVP-Outlook]

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
 

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