Header
PowerPoint tips, hints and tutorials that will change your presentations for ever!

INDEX

 

Jigsaws
Sounds
Video
Custom Shows
vba code
NaviSlides
Games for teachers
Bullets
Triggers
Security
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Animation
Hyperlinks
Set spellcheck language


Home buttonTutorial buttonContact buttonProducts button


PowerPoint - Email Test Results

You've created a test or  a training program in PowerPoint and you would like the presentation to Email the results or maybe a completion message.

There's no inbuilt way to do this but if the PC has a full version of Outlook then this function will do the job. As with all vba you need to be sure that security allows the code to run. You can adapt the calling sub to suit you needs, maybe adding a name or title.

Sub sendmail()
Dim ret As Boolean
Dim strAddress As String
Dim strMessage As String
strAddress = "whatever@whatever.com"
strMessage = ActivePresentation.Slides(1).Shapes(3).TextFrame.TextRange ' change to suit
ret = SendEMail(strAddress, "From PowerPoint", strMessage)
MsgBox "Mail sent= " & ret
End Sub

Public Function SendEMail(strRecipient As String, strSubject As String, strBody As String) As Boolean
Dim oApp As Object
Dim oMail As Object
Err.Clear
On Error Resume Next
Set oApp = GetObject(Class:="Outlook.Application")
If Err <> 0 Then Set oApp = CreateObject("Outlook.Application")
Err.Clear
Set oMail = oApp.CreateItem(0)
With oMail
.Subject = strSubject
.To = strRecipient
'copy to self
.CC = "youraddy@you.com"
.BodyFormat = 1
.Body = strBody
.Send
End With
'cleanup
Set oMail = Nothing
Set oApp = Nothing
'All OK?
If Err = 0 Then SendEMail = True Else SendEMail = False
End Function

 

 

Back to the Index Page

POWERPOINT BLOG

Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation