Address EMail from table?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ShyGuy

    #1

    Address EMail from table?

    Is there a way to fill the To: box in Outlook using email addresses
    from a table?
  • ManningFan

    #2
    Re: Address EMail from table?

    Yes.

    ShyGuy wrote:
    Is there a way to fill the To: box in Outlook using email addresses
    from a table?

    Comment

    • pietlinden@hotmail.com

      #3
      Re: Address EMail from table?


      ShyGuy wrote:
      Is there a way to fill the To: box in Outlook using email addresses
      from a table?
      I'd have thought you'd have seen this before... somewhere you open a
      recordset, then you just

      olkMsg.To = rsRecipients.Fi elds("EmailAddr ess")
      etc

      look around... Danny Lesandrini has an example at his site
      amazecreations. com/datafast

      there are examples all over the place here... just search the NG.

      Comment

      • ShyGuy

        #4
        Re: Address EMail from table?

        On 14 Dec 2006 17:16:28 -0800, pietlinden@hotm ail.com wrote:
        >
        >ShyGuy wrote:
        >Is there a way to fill the To: box in Outlook using email addresses
        >from a table?
        >
        >I'd have thought you'd have seen this before... somewhere you open a
        >recordset, then you just
        >
        >olkMsg.To = rsRecipients.Fi elds("EmailAddr ess")
        >etc
        >
        >look around... Danny Lesandrini has an example at his site
        >amazecreations .com/datafast
        >
        >there are examples all over the place here... just search the NG.

        I checked this site but the examples don't seem to do what I need. I
        have a form with a list of email addresses. I want to be able to
        check any number of these and have Access open and put the checked
        names into the send box.

        Comment

        • pietlinden@hotmail.com

          #5
          Re: Address EMail from table?


          ShyGuy wrote:
          On 14 Dec 2006 17:16:28 -0800, pietlinden@hotm ail.com wrote:
          >

          ShyGuy wrote:
          Is there a way to fill the To: box in Outlook using email addresses
          from a table?
          I'd have thought you'd have seen this before... somewhere you open a
          recordset, then you just

          olkMsg.To = rsRecipients.Fi elds("EmailAddr ess")
          etc

          look around... Danny Lesandrini has an example at his site
          amazecreations. com/datafast

          there are examples all over the place here... just search the NG.
          >
          >
          I checked this site but the examples don't seem to do what I need. I
          have a form with a list of email addresses. I want to be able to
          check any number of these and have Access open and put the checked
          names into the send box.
          are they separate records? delimited values? (Psychic abilities
          failing) How about an example? subform records? The more specific
          you are about what you are dealing with, the easier it is to solve your
          problem. Basically, you need to grab the individual values (try Split,
          maybe?) and then loop through the items in the resulting array and add
          them to the Recipients collection. Or could we see your code or could
          you describe exactly what your form looks like? (or the form/subform
          record sources?)

          Comment

          • pietlinden@hotmail.com

            #6
            Re: Address EMail from table?


            ShyGuy wrote:
            Is there a way to fill the To: box in Outlook using email addresses
            from a table?
            dim rs as dao.recordset
            set rs = dbengine(0)(0). OpenRecordset(" tblWithEmail",d bOpenTable)
            do until rs.EOF
            olkMsg.Recipien ts.Add rs.Fields("EMai lAddress")
            rs.MoveNext
            loop

            rs.close
            set rs=nothing
            olkMsg.Send

            Of course it's missing all the unnecessary guts. the body, the
            subject... but that should get you started.

            Comment

            • ShyGuy

              #7
              Re: Address EMail from table?

              On 14 Dec 2006 19:09:27 -0800, pietlinden@hotm ail.com wrote:
              >
              >ShyGuy wrote:
              >On 14 Dec 2006 17:16:28 -0800, pietlinden@hotm ail.com wrote:
              >>
              >
              >ShyGuy wrote:
              >Is there a way to fill the To: box in Outlook using email addresses
              >from a table?
              >
              >I'd have thought you'd have seen this before... somewhere you open a
              >recordset, then you just
              >
              >olkMsg.To = rsRecipients.Fi elds("EmailAddr ess")
              >etc
              >
              >look around... Danny Lesandrini has an example at his site
              >amazecreations .com/datafast
              >
              >there are examples all over the place here... just search the NG.
              >>
              >>
              >I checked this site but the examples don't seem to do what I need. I
              >have a form with a list of email addresses. I want to be able to
              >check any number of these and have Access open and put the checked
              >names into the send box.
              >
              >are they separate records? delimited values? (Psychic abilities
              >failing) How about an example? subform records? The more specific
              >you are about what you are dealing with, the easier it is to solve your
              >problem. Basically, you need to grab the individual values (try Split,
              >maybe?) and then loop through the items in the resulting array and add
              >them to the Recipients collection. Or could we see your code or could
              >you describe exactly what your form looks like? (or the form/subform
              >record sources?)

              I do apologize. It seems I know so little about Access that I don't
              even know how to ask a proper question. ;-(

              I have a continuous form that is based on a table. Name, and Email
              Address and a check box..

              I check the people I want to send the email to and click a button
              which changes the control source to a query and the form now shows
              only the checked people. All I want to do is place the addresses in
              the Send to box in Outlook. I tried looping through the list but all
              I get is the first email multiple times.

              Comment

              • ShyGuy

                #8
                Re: Address EMail from table?

                On 14 Dec 2006 19:13:05 -0800, pietlinden@hotm ail.com wrote:
                >
                >ShyGuy wrote:
                >Is there a way to fill the To: box in Outlook using email addresses
                >from a table?
                >
                >dim rs as dao.recordset
                >set rs = dbengine(0)(0). OpenRecordset(" tblWithEmail",d bOpenTable)
                >do until rs.EOF
                olkMsg.Recipien ts.Add rs.Fields("EMai lAddress")
                rs.MoveNext
                >loop
                >
                >rs.close
                >set rs=nothing
                >olkMsg.Send
                >
                >Of course it's missing all the unnecessary guts. the body, the
                >subject... but that should get you started.

                OK! I used this code and was able to copy the checked email addresses
                into a text box on my form. I check the boxes I want. run a make
                table query and then use your code to read the email addresses from
                the table. I can't figure out what the olkMsg line is for and I get
                an Object required when I run the code, so I commented it out and it
                works. I am thinking it has something to do with Outlook, but don't
                know what to do with it.

                Thanks for your help. ;-)

                Comment

                • pietlinden@hotmail.com

                  #9
                  Re: Address EMail from table?

                  OK! I used this code and was able to copy the checked email addresses
                  into a text box on my form. I check the boxes I want. run a make
                  table query and then use your code to read the email addresses from
                  the table. I can't figure out what the olkMsg line is for and I get
                  an Object required when I run the code, so I commented it out and it
                  works. I am thinking it has something to do with Outlook, but don't
                  know what to do with it.
                  >
                  Thanks for your help. ;-)
                  Oh, if you stuff all the email addresses into a single record, then you
                  can probably use SendObject. if you use it, (or CDOSYS or whatever),
                  you don't need Outlook at all.

                  (olkMsg = Outlook.Message )

                  Comment

                  Working...