Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Jul 2002
    Location
    Colchester, Essex, England
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Button to send email (2003)

    We have developed some *.pps that will be hosted on our company intranet as an e-learning solution. On the final slide of the pps we want to have a button that users click to confirm that they have attended the training. When the users click the button we want an email to be sent to our project mailbox with a predefined subject line. We would preferably like the user to not see that Outlook launches and the email is created and then sent. Any ideas how all of this can be achieved would be greatfully appreciated !!!!!!!!!!!!!!!!.

    Jeff

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Button to send email (2003)

    You could use Automation to create and send an e-mail, but the enhanced security in Outlook will not let you send an e-mail unnoticed. You'd have to use Outlook Redemption to work around this.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Button to send email (2003)

    I think you should use a web page on your intranet. Place a link in the PPS file with any relevant parameters, such as:

    http://intranet/completed.asp?module4

    behind a pretty button. The page can generate the message.

    But now that I think about it, the page probably will not be able to identify the user personally without asking for that information (it would only know the user's computer's IP address). Hmmm...

  4. #4
    Lounger
    Join Date
    Jul 2002
    Location
    Colchester, Essex, England
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button to send email (2003)

    Thanks guys... definately need some code for the button so that it sends an email....not even concerned now if Outlook does pop up on clients screen.

  5. #5
    Lounger
    Join Date
    Jul 2002
    Location
    Colchester, Essex, England
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button to send email (2003)

    Thanks Hans....any help with some code / automation to send an email would be greatful....not even concerned if client sees Outlook coming up on screen now due to time pressures.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Button to send email (2003)

    Here is some sample code. Modify as needed.

    Sub SendCompletion()
    Dim objOL As Object
    Dim objMail As Object
    Dim blnStart As Boolean

    On Error Resume Next
    Set objOL = GetObject(, "Outlook.Application")
    If objOL Is Nothing Then
    Set objOL = CreateObject("Outlook.Application")
    If objOL Is Nothing Then
    MsgBox "Can't start Outlook.", vbInformation
    Exit Sub
    blnStart = True
    End If
    End If
    On Error GoTo ErrHandler
    Set objMail = objOL.CreateItem(0)
    With objMail
    ' *** Make sure to modify the following lines ***
    .To = "somebody@company.com"
    .Subject = "E-learning completed"
    .Body = "Blah blah" & vbCrLf & "Cheers"
    .Send
    End With

    ExitHandler:
    On Error Resume Next
    Set objMail = Nothing
    If blnStart Then
    objOL.Quit
    End If
    Set objOL = Nothing
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •