Results 1 to 3 of 3

Thread: SendObject - not email attachment? [Resolved]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    SendObject - not email attachment? [Resolved]

    I'm using SendObject to send the results of a query to some co-workers in an Outlook email. The old way is to cut and paste the results directly into the email. I'm trying to automate this, but SendObject sends the results as an attachment, and the e-mail as plain text (no matter what I have my mail format set to).
    Is there any way to have the query results directly in the email? Maybe autopaste it in the message body parameter of SendObject? Thanks.
    Last edited by salvelinus; Dec 11th, 2003 at 12:57 PM.

  2. #2
    Lively Member
    Join Date
    Nov 2002
    Location
    Leeds, England
    Posts
    85
    I dont quite understand your question
    but it seems like a similar problem i had.

    when you create the email to send off
    e.g.
    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

    just set the body to whatever you want to display

    objOutlookMsg.Body = "whatever you want".

    The problem i had was i wanted to display all the results of a query so all i did was create a string variable then looped through the recordset adding to the string eachtime

    VB Code:
    1. Dim BodyString as String, i as integer
    2. rsRecords.MoveFirst
    3. For i = 0  To rsrecords.RecordCount
    4.              BodyString = BodyString & vbNewLine & rsRecords!IssueArray & " -Rev: " & rsRecords!Rev & "; Title: " & rsRecords!Title
    5. rsRecords.MoveNext
    6. Next i
    7.  
    8. 'Then make BodyString be the bodt of the message
    9.  
    10. objOutlookMsg.Body = BodyString


    I hope this helps or is what your looking for.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Thanks, I figured out pretty much the same thing, but used DoCmd.SendObject. The original query was in a macro, no recordset was in code, so I recreated it in code. Appreciate the help.

Posting Permissions

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



Click Here to Expand Forum to Full Width