Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make PB wait till message object has a value?

Status
Not open for further replies.

anneoctaaf

Programmer
Dec 15, 2003
104
0
0
NL
At the clicked event of a button i've got the following code:
The idea is to open a new window where the user can write some tekst that needs to be put in the mail message. Right now it opens the window w_email, but also continues to execute the rest of the code in this event. While i want PB to wait till the user has entered the text, pushed the button 'ok' in w_email, so that ls_tekst is filled. How can i do this?

Thanx!

OpenWithParm(w_email, li_bon)

//get text for email
ls_tekst = message.StringParm

lms_MAPISession = CREATE mailsession
IF lms_MAPISession.MailLogon() = MailReturnSuccess! THEN
// Mail Session is ok so Populate the Message
lmm_Message.Subject = "My mail"
lmm_Message.NoteText = ls_tekst
lmm_Message.Recipient[ 1 ].Name = 'Jan'
lmm_Message.Recipient[ 2 ].Name = 'Piet'
lmm_Message.Recipient[ 1 ].Address 'Jan@mail.nl'
lmm_Message.Recipient[ 2 ].Address = 'Piet@mail.nl'
IF lms_MAPISession.MailSend( lmm_Message ) = MailReturnSuccess! THEN
Messagebox( 'Email', 'Mail is send.' )
END IF

lms_MAPISession.MailLogoff()
END IF

DESTROY lms_MAPISession
 
Make it a response window and the event will not continue until the opened window has closed.
 
u need to check
ls_tekst = message.StringParm

if (ls_tekst ) != null then
do any activity further

but as per ur code..irrespective of any condition it just goes ahead creating the mail session

Anjali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top