Help with Schoolproject

J

Joost

Im trying to make a schoolproject with excel.

I have 2 tables, one contains info bout supliers: Suplier ID, Nam
suplier, Adress, City, Postal code, Phone# and Emailadress.
Two contains info about products: Serial number, Product name, Price
Supply.

Now here is what I want excel to do for me. If one off the supplies i
changed into 1 or zero, then I want excel to send an automatic email t
the suplier to order a new supply.

Hope anyone could help me out, this is pretty important for me.

Thanks in advance,

Joost Kno
 
J

Joost

I use Excel 2000 and Outlook 2000.
I see alot off programming on that URL u gave me. The problem is, I'm
not a very experienced programmer and it is hard to form a good script
for me.

i know how to get the info from a cel, with the range option, but i
dont know to put the function in it to look if the value is 1 or zero,
i know the IF... Then statement but not how to use it...
I also know how to email something but not how to put it in...

Greetz Joost
 
J

Joost

I made this, doesn't work offcourse :rolleyes:

Sub Mail_Body_Outlook()
If Worksheets("blad1").Range(L2) <= "1" Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
To = "(e-mail address removed)"
CC = ""
BCC = ""
Subject = "Bestelling"
Body = "Bij deze zou ik graag 20 nieuwe CD-ROM spelers
willen bestellen"
Send
End With
End If
End Sub
 
H

Harald Staff

You're very close I think. Very impressive
Adding to Don:

With OutMail
..To = "(e-mail address removed)"
..CC = ""
..BCC = ""
..Subject = "Bestelling"
..Body = "Bij deze zou ik graag 20 nieuwe CD-ROM spelers willen bestellen"
..Send
End With

Note the . in from of everything inside the With block, it points to "what ?". Excel
doesn't have a Send property, so address it to OutMail with the . in front.

Haven't tested this. No Outlook installed.
 
Z

___Zoom

I think one of the codes line should be as:
---------------------------------------
If Worksheets("blad1").Range("L2") < 1 Then
--------------------------------------
Then you don't get any 1004 errors.
I'll be happy to know if I can adapt this code so that it runs MS Outlook
Express rather then MS Outlook. Couse I don't like Outlook at all. Can
someone modify this for OE?
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top