Preview Email Message before Send

KeithWilliams

Registered User.
Local time
Today, 20:21
Joined
Feb 9, 2004
Messages
137
Hi,

I am sending an email generated from within my application. I want to allow the user to Preview it, and for the application to know whether or not they clicked Send. The code snippet is:

Code:
    argMailItem.Display True
    
    'Verify that the item was sent (by the user).
    On Error Resume Next
    boolMailSent = argMailItem.Sent

The mail item is displayed, but the Modal = True argument does not work as I would expect. The code continues and evaluates argMailItem.Sent before the user sends or closes the message. I can fix this by adding a MsgBox line after the Display call. This stops the code proceeding until the user has responded to the previewed mail item, and then displays the messagebox. But this is unsatisfactory because it will slow the user down.

Please let me know how I can check whether the user sent the message or not. Also, why does argMailItem.Display Modal=True not stop the subsequent code from running?

Thanks,
Keith.
 
KeithWilliams said:
Please let me know how I can check whether the user sent the message or not.
Just test it on yourself, or add it to a table, or have it BCC to you.


Why does argMailItem.Display Modal=True not stop the subsequent code from running?
Because you don't have it formatted correctly. Should be:
argMailItem.Display True 'no Modal required



But if you're going to have the "Display" then you might as well have them just manually send it. Display doesn't give you a preview, it gives you the actual mesage. They can make any changes they want to there. There really is no point in doing this whole process.
 
Last edited:
Hi Modest,

I think I didn't make myself clear. The code snippet I am having trouble with is:
Code:
    argMailItem.Display True
    
    'Verify that the item was sent (by the user).
    On Error Resume Next
    boolMailSent = argMailItem.Sent

Although this should display the message as Modal, the code continues running the subsequent lines.

I do actually want the user to view the message and either send or cancel it. Then I need to know whether they sent it or not.

Thanks,
Keith.
 

Users who are viewing this thread

Back
Top Bottom