+ Reply to Thread
Results 1 to 6 of 6

VB code to generate an e-mail with an EXCEL attachment, but not se

  1. #1
    MJ
    Guest

    VB code to generate an e-mail with an EXCEL attachment, but not se

    I have the code to send directly an e-mail with the attached EXCEL document
    (see below). However, I want to create the e-mail and allow the sender to
    add additional info in the e-mail before sending it. Is there code for this?

    Private Sub CmdSubmit_Click()
    WhereTo = Range("K2")
    SubjectText = "Example for " & Range("C3") & " - " & Range("C4")
    ActiveWorkbook.SendMail Recipients:=WhereTo, Subject:=SubjectText

    End Sub

  2. #2
    Ron de Bruin
    Guest

    Re: VB code to generate an e-mail with an EXCEL attachment, but not se

    Hi MJ

    See
    http://www.rondebruin.nl/mail/tips1.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "MJ" <[email protected]> wrote in message news:[email protected]...
    >I have the code to send directly an e-mail with the attached EXCEL document
    > (see below). However, I want to create the e-mail and allow the sender to
    > add additional info in the e-mail before sending it. Is there code for this?
    >
    > Private Sub CmdSubmit_Click()
    > WhereTo = Range("K2")
    > SubjectText = "Example for " & Range("C3") & " - " & Range("C4")
    > ActiveWorkbook.SendMail Recipients:=WhereTo, Subject:=SubjectText
    >
    > End Sub




  3. #3
    MJ
    Guest

    Re: VB code to generate an e-mail with an EXCEL attachment, but no

    Ron,

    I want to generate an Outlook message with the attached EXCEL document, but
    NOT send it directly as it does with the sendmail method. Often, my users
    want to add more to the message or attach another file before sending it. Is
    there code for this?

    "Ron de Bruin" wrote:

    > Hi MJ
    >
    > See
    > http://www.rondebruin.nl/mail/tips1.htm
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "MJ" <[email protected]> wrote in message news:[email protected]...
    > >I have the code to send directly an e-mail with the attached EXCEL document
    > > (see below). However, I want to create the e-mail and allow the sender to
    > > add additional info in the e-mail before sending it. Is there code for this?
    > >
    > > Private Sub CmdSubmit_Click()
    > > WhereTo = Range("K2")
    > > SubjectText = "Example for " & Range("C3") & " - " & Range("C4")
    > > ActiveWorkbook.SendMail Recipients:=WhereTo, Subject:=SubjectText
    > >
    > > End Sub

    >
    >
    >


  4. #4
    Ron de Bruin
    Guest

    Re: VB code to generate an e-mail with an EXCEL attachment, but no

    Have you read the tips page

    Your answer is there
    .SendMail "", "This is the Subject line"


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "MJ" <[email protected]> wrote in message news:[email protected]...
    > Ron,
    >
    > I want to generate an Outlook message with the attached EXCEL document, but
    > NOT send it directly as it does with the sendmail method. Often, my users
    > want to add more to the message or attach another file before sending it. Is
    > there code for this?
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi MJ
    >>
    >> See
    >> http://www.rondebruin.nl/mail/tips1.htm
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "MJ" <[email protected]> wrote in message news:[email protected]...
    >> >I have the code to send directly an e-mail with the attached EXCEL document
    >> > (see below). However, I want to create the e-mail and allow the sender to
    >> > add additional info in the e-mail before sending it. Is there code for this?
    >> >
    >> > Private Sub CmdSubmit_Click()
    >> > WhereTo = Range("K2")
    >> > SubjectText = "Example for " & Range("C3") & " - " & Range("C4")
    >> > ActiveWorkbook.SendMail Recipients:=WhereTo, Subject:=SubjectText
    >> >
    >> > End Sub

    >>
    >>
    >>




  5. #5
    MJ
    Guest

    Re: VB code to generate an e-mail with an EXCEL attachment, but no

    Yes, I read your tip. Putting the "" in the address, does prevent the
    message from being sent until the person selects the correct address.
    However, only I know who the message should be sent to (depending upon fields
    in the EXCEL form) and therefore want to include the address of my choosing.
    I just don't want to send the message without them being able to add
    additional info. Is their another field I can leave blank that will prevent
    the message from being sent, perhaps?

    MJ

    "Ron de Bruin" wrote:

    > Have you read the tips page
    >
    > Your answer is there
    > .SendMail "", "This is the Subject line"
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "MJ" <[email protected]> wrote in message news:[email protected]...
    > > Ron,
    > >
    > > I want to generate an Outlook message with the attached EXCEL document, but
    > > NOT send it directly as it does with the sendmail method. Often, my users
    > > want to add more to the message or attach another file before sending it. Is
    > > there code for this?
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi MJ
    > >>
    > >> See
    > >> http://www.rondebruin.nl/mail/tips1.htm
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >>
    > >> "MJ" <[email protected]> wrote in message news:[email protected]...
    > >> >I have the code to send directly an e-mail with the attached EXCEL document
    > >> > (see below). However, I want to create the e-mail and allow the sender to
    > >> > add additional info in the e-mail before sending it. Is there code for this?
    > >> >
    > >> > Private Sub CmdSubmit_Click()
    > >> > WhereTo = Range("K2")
    > >> > SubjectText = "Example for " & Range("C3") & " - " & Range("C4")
    > >> > ActiveWorkbook.SendMail Recipients:=WhereTo, Subject:=SubjectText
    > >> >
    > >> > End Sub
    > >>
    > >>
    > >>

    >
    >
    >


  6. #6
    Ron de Bruin
    Guest

    Re: VB code to generate an e-mail with an EXCEL attachment, but no

    This is the only way with SendMail

    But if you use Outlook you can use Display instead of Send
    See my site for the Outlook object model examples


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "MJ" <[email protected]> wrote in message news:[email protected]...
    > Yes, I read your tip. Putting the "" in the address, does prevent the
    > message from being sent until the person selects the correct address.
    > However, only I know who the message should be sent to (depending upon fields
    > in the EXCEL form) and therefore want to include the address of my choosing.
    > I just don't want to send the message without them being able to add
    > additional info. Is their another field I can leave blank that will prevent
    > the message from being sent, perhaps?
    >
    > MJ
    >
    > "Ron de Bruin" wrote:
    >
    >> Have you read the tips page
    >>
    >> Your answer is there
    >> .SendMail "", "This is the Subject line"
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "MJ" <[email protected]> wrote in message news:[email protected]...
    >> > Ron,
    >> >
    >> > I want to generate an Outlook message with the attached EXCEL document, but
    >> > NOT send it directly as it does with the sendmail method. Often, my users
    >> > want to add more to the message or attach another file before sending it. Is
    >> > there code for this?
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi MJ
    >> >>
    >> >> See
    >> >> http://www.rondebruin.nl/mail/tips1.htm
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >>
    >> >> "MJ" <[email protected]> wrote in message news:[email protected]...
    >> >> >I have the code to send directly an e-mail with the attached EXCEL document
    >> >> > (see below). However, I want to create the e-mail and allow the sender to
    >> >> > add additional info in the e-mail before sending it. Is there code for this?
    >> >> >
    >> >> > Private Sub CmdSubmit_Click()
    >> >> > WhereTo = Range("K2")
    >> >> > SubjectText = "Example for " & Range("C3") & " - " & Range("C4")
    >> >> > ActiveWorkbook.SendMail Recipients:=WhereTo, Subject:=SubjectText
    >> >> >
    >> >> > End Sub
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




+ 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