Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Toronto, Ontario, Canada
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Command button mailto (2002)

    I got a quick question, hopefully its a quick answer.
    I created a command button on a worksheet. When I click this button, I want the entire spread sheet to be emailed to a certain address.

    How can I do this?

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

    Re: Command button mailto (2002)

    In the subroutine (macro) that is executed by clicking the command button, you can put this code:

    ActiveWorkbook.SendMail "billg@microsoft.com", "Check out this spreadsheet!"

    If you created the button from the Forms toolbar, create a macro with this instruction in a standard module, and then right-click the command button and assign the macro.

    If you created the button from the Control Toolbox, double click it while in design mode, and enter the instruction in the Click routine.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Toronto, Ontario, Canada
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command button mailto (2002)

    Thanks a ton, you are seriously my hero.
    Happy Halloween!

  4. #4
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Toronto, Ontario, Canada
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command button mailto (2002)

    Hey Hans (or anyone),
    Is there a way to give the end user the option to enter comments (in the content) of the email?

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Command button mailto (2002)

    Check out this site it has lots of examples of sendmail

    Steve

  6. #6
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Toronto, Ontario, Canada
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command button mailto (2002)

    It doesnt look like the options listed on the webpage give the end user the chance to enter comments into the message.
    My only alternative is to add a row in the spread sheet dedicated to comments.

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

    Re: Command button mailto (2002)

    If you are using Outlook, you can use Automation (starting or activating another application, in this case Outlook, from Excel) to compose an e-mail message. Ron de Bruin's site contains examples of doing this. This can include asking the user to enter comments.

  8. #8
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Command button mailto (2002)

    It gives code for changing the body. You could ask if they want to add comments, if yes use an inputbox to get them and then add them to the body.

    See code under "change the body line"

    Steve

Posting Permissions

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