Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2006, 03:31 PM
Authorized User
 
Join Date: Mar 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Email with Excel

I want to simply send an email to me when a file is opened. Just to track usage. I cant seem to just send a message without attaching the file as well. Is there a way to just email a message? Like set the subject to the file name and that be it? Any help would be great.

 
Old January 2nd, 2007, 06:02 AM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can send mail by puting the code in workbook open

Private Sub Workbook_Open()

        Recipient = "[email protected]"
        subj = "Emergency"
        msg = "Dear "
        msg = msg & "%0A" & "Your file has been viewed some person "
        msg = msg & "%0A" & "Regards"
        msg = msg & "%0A" & "name"
        HLink = "mailto:" & Recipient
        HLink = HLink & "subject=" & subj & "&"
        HLink = HLink & "body=" & msg
        ActiveWorkbook.FollowHyperlink (HLink)
        Application.Wait (Now + TimeValue("0:00:02"))
        SendKeys "%s", True
        MsgBox "message sent to " & Recipient


End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Excel to Email krose Excel VBA 0 November 14th, 2007 12:42 PM
Send email from Excel Danny_n Excel VBA 18 May 16th, 2007 03:37 PM
group email from excel sarahbearah Excel VBA 1 June 5th, 2006 04:50 AM
HELP Excel auto email jmunda Excel VBA 1 April 1st, 2005 06:33 AM
Email Updates from Excel pstaffeld Excel VBA 1 August 20th, 2003 07:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.