How can I automatically send an email with delay from an Outlook inbox usign VBA?
<p>I'm new in the ways of VBA and I want to create a rule (script) that can automatically forward an email received in my Outlook inbox with a specified delay?
Can you please give me some instructions on how can I achieve this?</p>

<p>I tried:    </p>

<pre><code>Public Declare Sub Sleep Lib "kernel32" (ByVal dwMiliseconds As Long) 
Sub send(Item As Outlook.MailItem) 
Set fwd = Item.Forward 
fwd.Recipients.Add "mail@email.com" 
Sleep (10000) 
fwd.send 
End Sub
</code></pre>

<p>Also tried:</p>

<pre><code>Sub WasteTime(Finish As Long)

    Dim NowTick As Long
    Dim EndTick As Long

    EndTick = GetTickCount + (Finish * 1000)

    Do

        NowTick = GetTickCount
        DoEvents

    Loop Until NowTick &gt;= EndTick

End Sub


Sub send(Ite As Outlook.mailItem)
    Set fwd = Item.Forward
    fwd.Recipients.Add "mail@email.com"
    WasteTime (10)
    fwd.send
 End Sub
</code></pre>

<p>to no effect.</p>

<p>The 2nd code actually freezes my entire Outlook app which is not my desired effect. I only want to delay the re-sending of the email...</p>