Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Sending email

Discussion in 'Information Technology' started by SF, Jul 28, 2006.

Tags:
  1. SF

    SF
    Expand Collapse
    Guest

    Hi,

    The following code send an email out directly to the receipient. Is there a
    way to let user type the subject and body of the email before sending out.



    Private Sub Option2_Click()
    On Error GoTo Err_btnSendMail_Click

    DoCmd.Hourglass True
    Dim olApp As Outlook.Application
    Dim olMsg As Outlook.MailItem

    Set olApp = New Outlook.Application
    Set olMsg = CreateItem(olMailItem)

    With olMsg
    .To = Me.Co_EMail
    .Subject = "cmd Buttom Testing..."
    .Body = "Hey delete me now"
    .Send
    End With
    DoCmd.Hourglass False
    Exit_btnSendMail_Click:
    Exit Sub

    Err_btnSendMail_Click:
    MsgBox Err.Number & " " & Err.Description, vbOKOnly + vbInformation
    Resume Exit_btnSendMail_Click
    End Sub

    Sf
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Why This Sikh Cartoonist Is Sending A Postcard To Trump Every Day Breaking News Mar 23, 2016
    Canada Canada sending dossier on fraud immigration agents to Punjab Breaking News Sep 27, 2010
    Controversial Man stands by email: "Lose the traditions, or stay in India" Hard Talk Aug 11, 2012
    Disgusting email about asthma, MS, ADD and autism Parenting Aug 10, 2011
    Man uses Facebook to hack women's email Hard Talk Jan 15, 2011

  3. Terry Kreft

    Terry Kreft
    Expand Collapse
    Guest

    Provide a form with a couple of textboxes where thy can type in what ou want
    them to type nd thn use the valu of te txt fields instead of your hardcoded
    strings.

    You can turn off the recordselectors and navigation buttons etc to make the
    form look fit for the purpose.


    --

    Terry Kreft


    "SF" <ssamnang@yahoo.com> wrote in message
    news:OJJdcPZmGHA.3980@TK2MSFTNGP02.phx.gbl...
    > Hi,
    >
    > The following code send an email out directly to the receipient. Is there

    a
    > way to let user type the subject and body of the email before sending out.
    >
    >
    >
    > Private Sub Option2_Click()
    > On Error GoTo Err_btnSendMail_Click
    >
    > DoCmd.Hourglass True
    > Dim olApp As Outlook.Application
    > Dim olMsg As Outlook.MailItem
    >
    > Set olApp = New Outlook.Application
    > Set olMsg = CreateItem(olMailItem)
    >
    > With olMsg
    > .To = Me.Co_EMail
    > .Subject = "cmd Buttom Testing..."
    > .Body = "Hey delete me now"
    > .Send
    > End With
    > DoCmd.Hourglass False
    > Exit_btnSendMail_Click:
    > Exit Sub
    >
    > Err_btnSendMail_Click:
    > MsgBox Err.Number & " " & Err.Description, vbOKOnly + vbInformation
    > Resume Exit_btnSendMail_Click
    > End Sub
    >
    > Sf
    >
    >
     

Share This Page