+ Reply to Thread
Results 1 to 3 of 3

sending worksheet by email using control button

  1. #1
    Registered User
    Join Date
    02-12-2005
    Posts
    6

    sending worksheet by email using control button

    Hi,

    I have been going through old posts looking to find out how to send a worksheet to a fixed address using outlook and macros. I have found a number of posts on this but to me the answers seem to be in a foreign language.

    Is there an easy way to automate this or will I need to study VBS.

    I have set up a telephone directory for our company and would like to be able to offer staff the ability to send alterations using a macro in a worksheet automatically to me.


    Any help you can give would be appreciated.
    Last edited by kiwicolin; 02-24-2005 at 04:37 AM.

  2. #2
    Registered User
    Join Date
    04-14-2004
    Posts
    12

    Emailing using a control button

    I'm not the most qualified but I'll try to help you.

    There are two ways to do this. The first (easier) opens an email, attaches the active worksheet and the user types in your email address, subject and text, then clicks send.

    The second (harder) is invisible to the user. They click the button and the VB sends a predefined email to predefined recipients.

    Method 1: create a control button, right-click it and select "View Code.". In the blank code, insert
    Application.Dialogs(xlDialogSendMail).Show

    Method 2: I've gotten this to work only with some luck and by copying code from other forum responses. Here's some sample code.

    'Select the worksheet with the range to be sent.
    Worksheets("SheetName").Activate

    ' Select the range of cells on the active worksheet.
    ActiveSheet.Range("RangeName").Select 'name of your predefined range
    ActiveWorkbook.EnvelopeVisible = False 'this keeps the email from showing on screen.

    With ActiveSheet.MailEnvelope
    .Introduction = "Here is a correction I made"
    .Item.To = "[email protected]"
    .Item.Cc = "[email protected]" 'if you want someone cc'd on the message
    .Item.Subject = "Correction to the phone list"
    .Item.Send
    End With


    If I've assumed to much familiarity with VB or control buttons, let me know and I'll try to provide details. Also, maybe others can help if they see I've not explained this very well. Hope it helps!

    Matt

  3. #3
    Registered User
    Join Date
    02-12-2005
    Posts
    6
    Matt,


    Thanks for your post. The second option sounds good to me as we would like the whole operation of this to be foolproof to the end user.

    However my skills are severely limited re VB i.e almost none, but I am going home tonight to put it to the test.



    Regards

    Colin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1