I have the following code, the only thing it is not doing is timing out. What am I
missing? Thanks in advance.

Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
Dim intButton : intButton = WshShell.Popup ("Do you wish EMail to be sent?", 5, "Send
Email?", 1 + 32)

Select Case intButton
Case 2

Case Else
Dim myAttachments, olMailItem, AppActivate

Dim objOutlook : Set objOutlook = CreateObject("Outlook.Application")
Dim itmMail : Set itmMail = objOutlook.CreateItem(olMailItem)

With itmMail
'Display is optional
.Display
.To = strTo
.Subject = strSubject
.Body = strTextBody
End With

'-- It's advised to save items before sending
itmMail.Save

'adding attachments.
If not strAttachment = "" Then
Set myAttachments = itmMail.Attachments
myAttachments.Add strAttachment
End If

'Instead of itmMail.Send, use the SendKeys feature.
WshShell.AppActivate itmMail
'"%S" = "Ctrl S"
WshShell.SendKeys("%s")
End Select

Re: Help with popup by ThatsIT

ThatsIT
Mon Apr 09 06:58:43 CDT 2007

"E C H (He of too much code)" <glasswalkertheurge@juno.com> wrote in message
news:edKoJSleHHA.4020@TK2MSFTNGP06.phx.gbl...
>I have the following code, the only thing it is not doing is timing out.
>What am I missing? Thanks in advance.
>
> Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
> Dim intButton : intButton = WshShell.Popup ("Do you wish EMail to be
> sent?", 5, "Send Email?", 1 + 32)
>
> Select Case intButton
> Case 2
>
> Case Else
> Dim myAttachments, olMailItem, AppActivate
>
> Dim objOutlook : Set objOutlook = CreateObject("Outlook.Application")
> Dim itmMail : Set itmMail = objOutlook.CreateItem(olMailItem)
>
> With itmMail
> 'Display is optional
> .Display
> .To = strTo
> .Subject = strSubject
> .Body = strTextBody
> End With
>
> '-- It's advised to save items before sending
> itmMail.Save
>
> 'adding attachments.
> If not strAttachment = "" Then
> Set myAttachments = itmMail.Attachments
> myAttachments.Add strAttachment
> End If
>
> 'Instead of itmMail.Send, use the SendKeys feature.
> WshShell.AppActivate itmMail
> '"%S" = "Ctrl S"
> WshShell.SendKeys("%s")
> End Select


I copied your script and ran it, it worked fine for me.


Re: Help with popup by E

E
Mon Apr 09 07:47:24 CDT 2007

ThatsIT.net.au wrote:
> "E C H (He of too much code)" <glasswalkertheurge@juno.com> wrote in
> message news:edKoJSleHHA.4020@TK2MSFTNGP06.phx.gbl...
>> I have the following code, the only thing it is not doing is timing
>> out. What am I missing? Thanks in advance.
>>
>> Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
>> Dim intButton : intButton = WshShell.Popup ("Do you wish EMail to be
>> sent?", 5, "Send Email?", 1 + 32)
>>
>> Select Case intButton
>> Case 2
>>
>> Case Else
>> Dim myAttachments, olMailItem, AppActivate
>>
>> Dim objOutlook : Set objOutlook = CreateObject("Outlook.Application")
>> Dim itmMail : Set itmMail = objOutlook.CreateItem(olMailItem)
>>
>> With itmMail
>> 'Display is optional
>> .Display
>> .To = strTo
>> .Subject = strSubject
>> .Body = strTextBody
>> End With
>>
>> '-- It's advised to save items before sending
>> itmMail.Save
>>
>> 'adding attachments.
>> If not strAttachment = "" Then
>> Set myAttachments = itmMail.Attachments
>> myAttachments.Add strAttachment
>> End If
>>
>> 'Instead of itmMail.Send, use the SendKeys feature.
>> WshShell.AppActivate itmMail
>> '"%S" = "Ctrl S"
>> WshShell.SendKeys("%s")
>> End Select
>
>
> I copied your script and ran it, it worked fine for me.
When the popup appears, does it automatically go away after 5 seconds?

Re: Help with popup by ThatsIT

ThatsIT
Mon Apr 09 10:59:34 CDT 2007


"E C H (He of too much code)" <glasswalkertheurge@juno.com> wrote in message
news:%23eBk8UqeHHA.3632@TK2MSFTNGP02.phx.gbl...
> ThatsIT.net.au wrote:
>> "E C H (He of too much code)" <glasswalkertheurge@juno.com> wrote in
>> message news:edKoJSleHHA.4020@TK2MSFTNGP06.phx.gbl...
>>> I have the following code, the only thing it is not doing is timing out.
>>> What am I missing? Thanks in advance.
>>>
>>> Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
>>> Dim intButton : intButton = WshShell.Popup ("Do you wish EMail to be
>>> sent?", 5, "Send Email?", 1 + 32)
>>>
>>> Select Case intButton
>>> Case 2
>>>
>>> Case Else
>>> Dim myAttachments, olMailItem, AppActivate
>>>
>>> Dim objOutlook : Set objOutlook = CreateObject("Outlook.Application")
>>> Dim itmMail : Set itmMail = objOutlook.CreateItem(olMailItem)
>>>
>>> With itmMail
>>> 'Display is optional
>>> .Display
>>> .To = strTo
>>> .Subject = strSubject
>>> .Body = strTextBody
>>> End With
>>>
>>> '-- It's advised to save items before sending
>>> itmMail.Save
>>>
>>> 'adding attachments.
>>> If not strAttachment = "" Then
>>> Set myAttachments = itmMail.Attachments
>>> myAttachments.Add strAttachment
>>> End If
>>>
>>> 'Instead of itmMail.Send, use the SendKeys feature.
>>> WshShell.AppActivate itmMail
>>> '"%S" = "Ctrl S"
>>> WshShell.SendKeys("%s")
>>> End Select
>>
>>
>> I copied your script and ran it, it worked fine for me.
> When the popup appears, does it automatically go away after 5 seconds?

Yes it does I'm running Vista by the way