PDA

Click to See Complete Forum and Search --> : [RESOLVED] getting the contact address from query in access


parisa_ch
Apr 19th, 2006, 12:34 PM
hello
i was wondering if anyone could help me with mail
merging outlook from access!!!
thanks in advance
:thumb:

RobDog888
Apr 19th, 2006, 01:05 PM
Usually a mailmerge will involve Word to some degree.

You need to give more information.

What version of Office?

parisa_ch
Apr 19th, 2006, 02:23 PM
i want to use the query to get the list of emails which i wan to send the emails to!!!
can you help plz!!!

RobDog888
Apr 20th, 2006, 02:26 AM
You will want to add a reference to Microsoft ActiveX Data Objects 2.x Library in Outlooks VBA IDE. Then its basic ADO code to connect and retrieve the recordset. See tutorial located here - http://www.vbforums.com/showthread.php?t=337051

Then its a matter of creating an email and adding the email addresses to its To property.

parisa_ch
Apr 20th, 2006, 11:06 AM
i want to send the bills qutomatically to the customers
how can i do so ?!
the point is that i need to get the emails of the customers from the query and then somehow use them in outlook to send them ?!
can anyone help?!

Hack
Apr 20th, 2006, 11:09 AM
By "get the emails" do you mean get email addresses that are stored in your database?

Hack
Apr 20th, 2006, 11:15 AM
Are you using VB6 or Outlook VBA?

Hack
Apr 20th, 2006, 11:45 AM
I think I should merge the threads as I have found another duplicate thread in the db forum.

http://www.vbforums.com/showthread.php?t=400239My intent was to merge, but I don't know whether the resulting single thread should be in ClassicVb or Office Development.

I guess you can just pick one, and then move if necessary as the member has not responded to the question on what platform he is using.

RobDog888
Apr 20th, 2006, 11:48 AM
Threads Merged. :)

I choose the Office Dev forum as its contains both Access and Outlook.

parisa_ch
Apr 20th, 2006, 01:36 PM
well i don't it should be complicated i just want to emeil the bills which are made in access to the customers automatically after one month !!!
what should i do !!!!!!!!!!!!!!!!!!????????????????????

salvelinus
Apr 21st, 2006, 12:11 PM
well i don't it should be complicated i just want to emeil the bills which are made in access to the customers automatically after one month !!!
what should i do !!!!!!!!!!!!!!!!!!????????????????????
Answer the questions asked above.

parisa_ch
Apr 21st, 2006, 12:26 PM
what question?
i'm suppose to get the answer from someone i mean if i knew the answer i would have done it myself.

salvelinus
Apr 21st, 2006, 12:36 PM
See posts 6 & 7 by Hack above. No one can really help until you give more information.

RobDog888
Apr 21st, 2006, 01:41 PM
We can help you but just giving a generic scnerio doesnt help us to help you. :)

Btw, what version of Office and what OS will this be on? Is it for distribution or just on your system?

parisa_ch
Apr 21st, 2006, 01:59 PM
well let me tell you my course work
this system is used on a single worksation in a center which is used to make booking for the village hall
now one of the things this system is sopposed to do is to produce bills for the customers who made the booking and in order to save money oon postage just email it to them instead i want to get the system to email the bills automatically at the end of each month.
can you help me now please.
thank you

parisa_ch
Apr 21st, 2006, 02:00 PM
the bookings are save in the database so the emails are saved in the customer table.

RobDog888
Apr 21st, 2006, 02:03 PM
Ok, but are you using VB6 or the VBA behind Access or Outlook?

Also, which version Office and Operating System?

parisa_ch
Apr 21st, 2006, 04:27 PM
well i haven't done anything in outlook yet
i have ony started programming i don't know what to do?!!??!!?

salvelinus
Apr 21st, 2006, 08:43 PM
From your comment above stating this is "course work", I'll assume this is a school assignment.
You still haven't answered any of the questions above. I'm not going to repeat them for you, since you seem intent on ignoring them.
In all sincerity, why do you expect people here to help you when you ignore their requests for more information?
I understand that you may be a complete newcomer to coding and Visual Basic, but that doesn't explain why you don't answer the questions of people who try to help you.

RobDog888
Apr 21st, 2006, 10:03 PM
Plus, everyone is wiling to help but no one will write all the code for you. You need to let us know the answers and be willing to make an effort. ;)

parisa_ch
Apr 22nd, 2006, 06:39 AM
well i'm using vba
and window xp
sorry i didn't mean to ignore answering your questions!!!

salvelinus
Apr 22nd, 2006, 11:12 AM
Are you developing your app in Access or Outlook, and which version? VBA is a version of Visual Basic that is common to all Office programs - Access, Excel, Outlook, Word, etc., but the specifics of how you accomplish a particular task depend on which program you're using. For example, you can program Outlook to do things from code in Access, but the code would be different than if you were programming within Outlook itself and getting your names from a table in Access.

parisa_ch
Apr 22nd, 2006, 11:15 AM
well i'm tring to code stuff in access if possible but if it not possible than i would do it in outlook
which one is easier?

RobDog888
Apr 22nd, 2006, 01:41 PM
Easiest way to do this is in Access since you are using Access code already.

Create a recordset of your email addresses and then...
Do While oRs.EOF = False
Application.DoCmd.SendObject acSendNoObject, , acFormatTXT, oRs.Fields("EmailAddress").Value, , , "Spam", "This is the message text", False
oRs.MoveNext
Loop

parisa_ch
Apr 22nd, 2006, 01:45 PM
where should i put this code.i'm mean which part of access?the table?

parisa_ch
Apr 22nd, 2006, 01:46 PM
i think since i'm sending the reports i should put it some where in the report.or should i make a command button and then locate it there?!

RobDog888
Apr 22nd, 2006, 01:47 PM
You can place it behind your form in a button click event procedure.

You can not place any code behind a table. ;)

You also need to create your recordset of the email addresses.

RobDog888
Apr 22nd, 2006, 01:49 PM
If your sending an object, like a report, then you need to change the code a bit. Change acSendNoObject to acSendReport and then the next parameter (the blank one) will be the report name.

parisa_ch
Apr 22nd, 2006, 01:50 PM
thank you

parisa_ch
Apr 22nd, 2006, 01:52 PM
what should i do if i want the system to send it automatically at the end of each month?!

RobDog888
Apr 22nd, 2006, 01:54 PM
You would need to keep your db open and use an API or two to create a timer event checking what day it is, once a day. Then if its determined to be the last day, call the procedure to send the emails.

parisa_ch
Apr 22nd, 2006, 01:58 PM
well i have linked visual basic 6.0 to access to make my coursework a bit more complicated than the others :D (trying to be smart) :)))))))
now should i put the timer in the visual basic codes and use the format function thing?!

RobDog888
Apr 22nd, 2006, 02:01 PM
So then your using a combination of Access VBA and VB6.

Yes, you will place a timer control on a form and in the timer event decide if you want to email the reports or not.

parisa_ch
Apr 22nd, 2006, 02:02 PM
c00o0o0o0ol
thank you