From: Wi11y13 on
I need to send a pre-populated e-mail utilizing whatever application is
default on the users machine. This is in VBA from a PowerPoint slideshow. I
am able to actually create the e-mail and it comes up on the screen but I
need to have it automatically sent such that the user never actually sees it
and does not need to be involved in the sending action.

I have created (with lots of internet help) the following code (please
excuse as I am sure it is not very professional - but it at least does create
the email):

Sub SendMyEMail()
Dim emaddr As String
Dim subj As String
Dim Name As String
Dim salutation As String
Dim hlink As Variant

emaddr = "myemailaddress(a)gmail.com"
subj = "Training Completion for "
ID = Environ("USERNAME")
salutation = "Completed"
'compose default parts of the message

hlink = "mailto:" & emaddr & "?"
hlink = hlink & "subject=" & subj & ID & "&"
hlink = hlink & "body=" & ID & " has completed the Training "

ActivePresentation.FollowHyperlink hlink

DoEvents

keybd_event VK_MENU, 0, 0, 0 ' set Alt
keybd_event vbKeyD, 0, 0, 0 ' set D key down
keybd_event vbKeyD, 0, KEYEVENTF_KEYUP, 0 ' set D key up
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0 ' set left win key up



End Sub

As you can see I have attempted to use the ALT-D key sequence but no luck. I
believe it is probably because the CPU is actually in the email application
and does not see the ALT-D until I exit from that application and come back
to Powerpoint.

Does anyone know how I can invoke this FollowHyperlink to automatically send
this email?

Thanks for the help

--
Wi11y13
From: Mike Glen on
Hi Willy,

This newsgroup is specifically for matters dealing with Microsoft Project.
I suggest you try to find a more appropriate newsgroup that deals with
Office problems.

Mike Glen
Project MVP



"Wi11y13" <Wi11y13(a)discussions.microsoft.com> wrote in message
news:C153E019-94B1-49E0-84E9-4100803AE65D(a)microsoft.com...
> I need to send a pre-populated e-mail utilizing whatever application is
> default on the users machine. This is in VBA from a PowerPoint slideshow.
> I
> am able to actually create the e-mail and it comes up on the screen but I
> need to have it automatically sent such that the user never actually sees
> it
> and does not need to be involved in the sending action.
>
> I have created (with lots of internet help) the following code (please
> excuse as I am sure it is not very professional - but it at least does
> create
> the email):
>
> Sub SendMyEMail()
> Dim emaddr As String
> Dim subj As String
> Dim Name As String
> Dim salutation As String
> Dim hlink As Variant
>
> emaddr = "myemailaddress(a)gmail.com"
> subj = "Training Completion for "
> ID = Environ("USERNAME")
> salutation = "Completed"
> 'compose default parts of the message
>
> hlink = "mailto:" & emaddr & "?"
> hlink = hlink & "subject=" & subj & ID & "&"
> hlink = hlink & "body=" & ID & " has completed the Training "
>
> ActivePresentation.FollowHyperlink hlink
>
> DoEvents
>
> keybd_event VK_MENU, 0, 0, 0 ' set Alt
> keybd_event vbKeyD, 0, 0, 0 ' set D key down
> keybd_event vbKeyD, 0, KEYEVENTF_KEYUP, 0 ' set D key up
> keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0 ' set left win key up
>
>
>
> End Sub
>
> As you can see I have attempted to use the ALT-D key sequence but no luck.
> I
> believe it is probably because the CPU is actually in the email
> application
> and does not see the ALT-D until I exit from that application and come
> back
> to Powerpoint.
>
> Does anyone know how I can invoke this FollowHyperlink to automatically
> send
> this email?
>
> Thanks for the help
>
> --
> Wi11y13