Waiting for a function to finish.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am running a third party libarary. (Redemption).
The program launches redemption just fine. the problem is that the
Redemption is telling Access that it is done right after it is lauched.

Redemption attaches a file to fourty different emails.
A lot of the emails don't have attachments.

It is my beliefe that Access is renaming the Attachment file before
Redemption has a chance to finish its work. I would like to force Access to
wait for the function that launches Redemption to finish. The following code
is what I came up with but I am not sure it works the way I think it does.

Function WaitForMe(StrProgramName As String)
Rem Wait for a program to finish.
Do While SysCmd(acSysCmdGetObjectState, acModule, "ISSMEMO")
DoEvents
Loop

End Function

Do you have a better way of doing this?
Scott Burke

P.S. The programmers at Redemption don't think this is the issue but the
program works fine on a slow computer. The faster computers are the ones
with the problems.
 
No. Redemption is run like a function.

Example:
Set myRecipient = safemail.recipients.Add("(e-mail address removed)")
myRecipient.Type = 1 ' 1=To,2=CC, 3=BCC
myAttachments.Add "T:\INTERCONTINENTAL\MEMOS\" & Myfile, 1, 1, Myfile
'Your attachment path

safemail.Subject = "Memo"
safemail.ReadReceiptRequested = False
safemail.OriginatorDeliveryReportRequested = False
safemail.send

I wont to run safemail and wait untill it is finished running.
I don't just wont to add a timer. I would really like to the program to
wait just long enuf for the function to run then let the Access program
continue.

Scott Burke
 
Nice try Alex but that will not work.
Once the command "safemail.send" is used the Redemption DLL. takes over and
merges the attachments and sends the email. there is no way to intercept
infomation from the "safemail".

When "safemail.send" is run, safemail issueds an all done signal to Access
then it does the job it is suppost too.

That is why I have to wait for safemail.

Scott Burke
 
Back
Top