Auto send e-mail with FollowHyperlink

W

Wi11y13

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 = "(e-mail address removed)"
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
 
M

Mike Glen

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
 
M

Mike Glen

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
 

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