Results 1 to 4 of 4

Thread: email

  1. #1
    Join Date
    Aug 2002
    Posts
    45

    Unanswered: email

    hi
    i have a function that exports to word.. is there a way of exporting to an email. specifically i need to from one table where the addresses lie send a email to all those addresess. the content of the email does not matter. i just need to create a blank email to all the addresess in the table.
    any one able to help?
    thanks
    cq
    Sent By Royal Mail

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Re: email

    Originally posted by colonelquinn
    hi
    i have a function that exports to word.. is there a way of exporting to an email. specifically i need to from one table where the addresses lie send a email to all those addresess. the content of the email does not matter. i just need to create a blank email to all the addresess in the table.
    any one able to help?
    thanks
    cq
    yes 2
    1 using the command
    DoCmd.SendObject

    2 using the email clients VB lib, ie
    Dim Message As String
    Dim rs As DAO.Recordset
    Dim email As Outlook.MailItem
    Set email = CreateObject("Outlook.Application").CreateItem(olM ailItem)
    With Form_ByStatusIf
    email.To = Replace(.User, " ", ".") & "@uk.agimedia.com"
    email.Subject = "Ref: " & .Refference & " RE:" & .DescriptionBrief
    email.Body = <data>
    email.Send
    End With
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Aug 2002
    Posts
    45
    thanks very much

    i need to open outlook so i can write the email. i dont know if what ive done will work especially the string of email addresses, any hints?

    Dim Message As String
    Dim recipients As String
    Dim rs As DAO.Recordset , dbs As Database
    Dim email As Outlook.MailItem
    set rs = dbs.OpenRecordset("Select email From Members;")
    Set email = CreateObject("Outlook.Application").CreateItem(olM ailItem)
    recipients = rst!email
    rst.movenext
    Do
    recipients = recipients & ";" & rst!email
    email.To = recipients
    email.Subject = "Letter"
    rst.movenext
    Loop until rst.Eof

    email.visible = true

    cq
    Sent By Royal Mail

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    Originally posted by colonelquinn
    thanks very much

    i need to open outlook so i can write the email. i dont know if what ive done will work especially the string of email addresses, any hints?
    cq
    i think you nearly there try this (i can't remember if it's .visible = true or just .display i always use .send)
    Dim recipients As String
    Dim rs As DAO.Recordset
    Dim email As Outlook.MailItem
    set rs = currentdb.OpenRecordset("Select email From Members;")
    Set email = CreateObject("Outlook.Application").CreateItem(olM ailItem)

    recipients = rst!email
    rst.movefirst

    while not rst.Eof
    recipients = recipients & ";" & rst!email
    rst.movenext
    wend

    email.To = recipients
    email.Subject = "Letter"
    email.visible = true
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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