.cbo and access 2007

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n8kindt
    New Member
    • Mar 2008
    • 221

    .cbo and access 2007

    i've got my hands full with this next project, and i could use a couple leads to give me a jump start.

    my final objective is to take each customer in our database and generate a report catered to them (using a where statement to filter for a certain characteristic) , pile all the filtered customers into the To: field (i can't find anything on how to include multiple recipients into the To: field), export the report into PDF as an attachment (i have access 2007 and have installed the optional PDF plug-in that allows access to export reports as such), and email them to the corresponding customer email using the CBO library (bypassing outlook).

    i have most of the pieces of the puzzle except, as i mentioned earlier, inserting multiple recipients into the "To:" field of the email, and inserting text into the body of the email.

    i think i'm set on the rest of it, but any tips concerning this project would be much appreciated.

    thanks, guys

    --nate

    PS - major problem #1 (already haha) i thought i saw something earlier about setting up my email to be sent thru an smtp server. i thought i could do this using gmail but i'm starting to think i'm horribly wrong. am i going to need my own server to do this?
  • n8kindt
    New Member
    • Mar 2008
    • 221

    #2
    Originally posted by n8kindt
    PS - major problem #1 (already haha) i thought i saw something earlier about setting up my email to be sent thru an smtp server. i thought i could do this using gmail but i'm starting to think i'm horribly wrong. am i going to need my own server to do this?
    ok, i was making this harder than it was. using the code from http://support.microsoft.com/kb/161833 got me on the right track. now, how do i populate the recipient list from a table provided that a certain condition is true about the recordset? i think i will use this page as a guide to creating my code: http://support.microsoft.com/?id=318881

    Comment

    • n8kindt
      New Member
      • Mar 2008
      • 221

      #3
      Originally posted by n8kindt
      how do i populate the recipient list from a table provided that a certain condition is true about the recordset?
      --------------------------------------------------------
      bump?

      Comment

      • LBryant
        New Member
        • Mar 2008
        • 18

        #4
        Stuff an array with your recipients, then iterate through the array to add your recipients to a message.

        Code:
                
        For i = 0 To UBound(gRecipientList) 'add recipients from array
             If gRecipientList(i) = "" Then Exit For
             Set objOutlookRecip = .Recipients.Add(gRecipientList(i)) 'add to requestor list
             objOutlookRecip.Type = olTo
        Next i
        
        For i = 0 To UBound(gAttachmentList)    'add attachments from array
             If gAttachmentList(i) <> "" Then .Attachments.Add gAttachmentList(i)
        Next i
        Would that work?

        Comment

        Working...