Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendObject Macro without attachments??

Status
Not open for further replies.

Hazmataz

Technical User
Joined
Oct 3, 2002
Messages
5
Location
GB
Hi,

I am a newbie to Access and trying to improve the database at work. I am using SendObject to send the data I require BUT the computers are a bit slow (as are the ladies in accounts) and they don't want to use attachments. So can I send the information I want in THE BODY of the EMail (we use Outlook 98) not as an attachment?

We use Access 97

Thanks in advance

Haz
 
Yes. Gather the info you want to send into a string and use that string for the message body. I haven't done it with a macro, but with vba call to SendObject, I was able to send a series of confirmations with all the peoples info (name, address, etc) to all new members and membership renewals.
 
Hi

Thanks for replying and sorry for being ignorant but the information comes from a query so how do I gather that information into a string? (I assume that string then goes in the 'message text' field in the macro?)

Thanks again

Haz
 
Are you looking to have the information read by people or have it imported into another database. What I was doing was going through all the textboxes on the member information form and just stringing them together with the label caption and line feed and carraige return. Something like:

MsgString = MsgString & LabelCaption & TextBoxContents & Chr(10) & Chr(13).

If it has to go into a table at the receiving end, you could do the same thing reading one field at a time and placing a pipe - Chr(124) - (or a comma or some other delimiter) between them. I think you would use the carraige return and line feed (or perhaps only one of them) between records. Then at the far end they strip out the message and import it as a text file
 
Hi,

The query uses todays date and then gets the Total Price, Company and Order Number for all orders placed that day.

It needs to arrive something like:

Company Price Order No.
Tek-tips 9.99 o1652485
Microsoft 18.50 o1652499

So yeah, it needs to be read by people.

Thanks for your help so far!

H
 
Ok.

In vba it would be something like

Dim db as database
Dim rs as recordset
Dim str as string

set db as currentdb
set rs as openrecordset("QueryName")

rs.movefirst
while not rs.eof
str = str & rs.Company & Chr(9) & rs.Price & Chr(9) & rs.OrderNo & chr(10) & Chr(13)
rs.movenext
Loop

docmd sendobject

place str in the proper place for the message body (the chr(9) is a tab.)
 
Hi

Thanks again but like I said I am a bit new to this:

Dim db as database
Dim rs as recordset
Dim str as string

set db as currentdb
set rs as openrecordset("QueryName")

rs.movefirst
while not rs.eof
str = str & rs.Company & Chr(9) & rs.Price & Chr(9) & rs.OrderNo & chr(10) & Chr(13)
rs.movenext
Loop

docmd sendobject

: That bit is the string right? where I just substitute QueryName and currentdb for the appropriate file names?

Thanks for your time

H
 
Hi

Can anyone help me with this topic? I am sure that what grnzbra put is correct but I don't really know how to implement it. Like I said I am quite new to this Access business!

Thanks

H
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top