Waiting for a function to finish.

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

Guest

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
 
G

Guest

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
 
G

Guest

Oh well, I guess I will just have to use a loop counter and be happy with it.

Scott Burke
 

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