Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Unanswered: Sending infomation within an email.

    Hi all,

    Is there a way in which i can send selected information (example: a userID from the user table) automatically once a button has been pressed to a email recipient using Access 2000.

    I have tried using the sendObject function, I can send the email automatically, but i cannot attach the userID or place it within the body of the message.

    Can you help?

    Regards,

    Skip.

  2. #2
    Join Date
    Sep 2003
    Location
    Nevada
    Posts
    8

    Try something like this...

    Example using a double click from a text field on the form

    Private Sub Emailaddr_DblClick(Cancel As Integer)
    On Error Resume Next
    If Emailaddr.Text = "" Or Len(Emailaddr.Text) = 0 Then Exit Sub

    Subj$ = "RE: Order#" & Ordernum.Value ' something for subject
    Body$ = UserId.Value & " " & "Whatever text you want to put here"
    ' the Body$ above could contain references to any field
    ' on your form that you want to include in your message.
    ' just format the string to your specs and the data will be included
    ' in the body of the message.
    ' the .Value reference pulls the data from the field withour the
    ' nasty ...not have focus error
    DoCmd.SendObject , , , Emailaddr.Text, , , Subj$, Body$ , True

    End Sub

    If you were using this from a button or some other command not within the actual fields you are pulling from, be sure to use the .Value reference instead of the .Text reference.

  3. #3
    Join Date
    Mar 2004
    Posts
    1
    Does anyone know how to create a carriage return in an email message?
    I have a message that I can send, but I want to have a space between the body of the text and the signature.

  4. #4
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    Originally posted by mandmlech
    Does anyone know how to create a carriage return in an email message?
    I have a message that I can send, but I want to have a space between the body of the text and the signature.
    vbCrLf --> Enters a carriage return and goes to the next line

    example :
    Code:
    Debug.Print 'Line 1'
    Debug.Print vbCrLf
    Debug.Print vbCrLf
    Debug.Print 'Line 2'
    result: --> shows 2 empty lines between 'Line 1' and 'Line 2'
    Line 1


    Line 2
    Last edited by artemide; 03-12-04 at 09:45.

Posting Permissions

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