Outlook 2003 - Close parent form before opening child form

R

Randy

Greetings,

Hope somebody in this group can help me with a (hopefully) simple
problem with Oulook 2003 forms.

How can I programatically close a parent form before it opens a child
form?

Any assitance will be much appreciated. Txs much in advance!!

Randy
 
S

Sue Mosher [MVP]

Tell us more about what "before it opens a child form" in your scenario.
Exactly how is one form causing another item to open?
 
R

Randy

Hi Sue, and txs for your reply.

The form is a very simple one, and has just two fields: COMMENTS and
HISTORY (both multiline text fields).

Here´s an example of the way the form will work:

User A opens the form (Tools/Form/Choose Form), types in a few
comments in the COMMENTS texbox, then sends the form to user B.

Before the form is sent:

1.- the current date and time are added to the user´s comments
2.- the contents of the COMMENTS field are added to the HISTORY field
3.- the COMMENTS field is cleared.

User B opens the form from his/her Inbox, clicks on Reply, types his/
her comments in the COMMENTS field and sends the form to user C.
Before the form is sent, date and time are added to user´s
comments.... and so on.

The forms that arrive in the users´ Inboxes are what I call "parent"
forms. Users open the parent forms and then click on Reply, launching
what I call a "child" form - the one they will use to type in their
comments.

Obviously, when the child form is launched, the parent form remains in
the background. Once an user sends out the child form, he will still
have to close the parent one.

Hope that this information will clarify what I am trying to do. Txs a
lot again for your reply!

Best,

R.
 
S

Sue Mosher [MVP]

First, a terminology clarification: What are sent are items or messages, not
forms. The form is only the UI/code template.

Since the user if creating a new item by replying, you can put code in the
Reply event handler to close the parent item, e.g.:

Function Item_Reply()
Const olDiscard = 1
Item.Close olDiscard
End Function
 
R

Randy

Sue,

Txs much for your reply. It worked!

I am, however, facing another problem now. A copy of every outgoing
item is being automatically saved to the Drafts folder. This doesn't
happen with any other type of item, like mails or contacts - just with
this custom form.

Do you have any idea why this could be happening?

Txs again for your help. Much appreciated!!

R.
 

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