|
-
Dec 11th, 2003, 10:32 AM
#1
Thread Starter
Frenzied Member
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.
-
Dec 11th, 2003, 12:08 PM
#2
Lively Member
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:
Dim BodyString as String, i as integer
rsRecords.MoveFirst
For i = 0 To rsrecords.RecordCount
BodyString = BodyString & vbNewLine & rsRecords!IssueArray & " -Rev: " & rsRecords!Rev & "; Title: " & rsRecords!Title
rsRecords.MoveNext
Next i
'Then make BodyString be the bodt of the message
objOutlookMsg.Body = BodyString
I hope this helps or is what your looking for.
-
Dec 11th, 2003, 12:56 PM
#3
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|