 |
 |

11-06-2003, 09:04 AM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
Need Help with outlook
|
I want to automize emailing , or more precific: on event emailing
if someting then email ...
I'm having trouble with the code
I can't remember the code exactly, but ist is similar to what you do with word and excel, but not quite.
it all falls down at the it's the "not quite" part
I can open an outlook session
I can add a recipient -even by only using the adressbook name
I can add a subject and I can send the email
I can't figure out how to creat a text body -the only "body" property I can find is only capable of creating single line emails.
I would like to create something like:
Code:
for i = 1 to NrOfMembers
emailObject.Recipient = mailinglistmember(i).email
emailObject.Subject = "N11 Touring Dates"
emailObject.body =
Dear & mailinglistmember(i).name
I hereby send you the following lists of the N11 gigs for next month"
(toggleBold)
[b]date location time[/b]
gig(1).date & TAB & gig(1).location & TAB & gig(1).time
gig(2).date & TAB & gig(1).location & TAB & gig(1).time
gig(3).date & TAB & gig(1).location & TAB & gig(1).time
gig(4).date & TAB & gig(1).location & TAB & gig(1).time
We hope te see you at any of these gigs
Yours sincerely
N11 forum administrator
next i
what I also would like is to make the email visible before sensing so I can see what is happening.
Can anyone help me?
|
|

11-06-2003, 09:17 AM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
add.
forgot the
before the "next i"
QC
|
|

11-06-2003, 09:52 AM
|
 |
Variable not defined
Retired Moderator * Guru *
|
|
Join Date: Apr 2002
Location: Ottawa, Ontario
Posts: 4,793
|
|
|
You need to use vbCrLf where you want the end of a line to be.
For example:
emailObject.body = "Hello" & vbCrLf & vbCrLf & "This is a test!"
would produce:
Hello
This is a test!
|
__________________
-Carl
|

11-06-2003, 10:04 AM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
thnx!
Quote: Originally Posted by Wamphyri You need to use vbCrLf where you want the end of a line to be.
For example:
emailObject.body = "Hello" & vbCrLf & vbCrLf & "This is a test!"
would produce:
Hello
This is a test!
|
|

11-07-2003, 03:29 AM
|
|
Senior Contributor
* Expert *
|
|
Join Date: Jan 2003
Location: Newbury, UK
Posts: 1,092
|
|
|
And you can use .Display rather than .Send to show the message.
|
|

11-09-2003, 02:49 AM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
How to integrate database data
The body tip with vbCrLf works nicely, but I still can't figure out how to fill the body with database data ...
I'm thinking of a table and fill it or use tabs:
Code:
for i = 1 to NrRows Do
for J = 1 to NrColumsn do
oMail.someting = a(i,j).text & vbTab & CrLf
next j
next i
QC
|
|

11-10-2003, 05:04 AM
|
|
Senior Contributor
* Expert *
|
|
Join Date: Jan 2003
Location: Newbury, UK
Posts: 1,092
|
|
|
Sounds OK. But don't forget you may need to have:
oMail.Body = oMail.Body & <<the next line>>
|
|

11-11-2003, 03:51 AM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
doesn't work, i get an error -someting about wrong number of arguments
Code:
myrange = "something" & vbCrLf
myrange = myrange & "something else" & vbCrLf
for i =1 to all
myrange = myrange & databese(i).item & vbCrLf
next i
myrange = vbCrLf& myrange & "something else" & vbCrLf
but thats' not what i had in mind though ... sadly
Does anyone know how to insert documents or sheets into an outlook email?
I saw " insert" in the top down menu:
insert
object
word doc / excel sheet /pps
Now If this can be done by hand-I'll bet ik can be done automatically with VB!!
Quote: Originally Posted by JordanChris Sounds OK. But don't forget you may need to have:
oMail.Body = oMail.Body & <<the next line>>
|
|

11-11-2003, 02:36 PM
|
|
Senior Contributor
* Expert *
|
|
Join Date: Jan 2003
Location: Newbury, UK
Posts: 1,092
|
|
|
I can't see why (assume: MyRange is a string) any of those lines would give a "wrong number of arguments". Maybe this line is wrong??: For i =1 To all
By "insert" do you mean Add Attachment??
|
|

11-12-2003, 05:08 AM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
Well vb highlights the "body" part ...
Uhmm ... I think it's because I tried to more than one oMail.body () 's in one statement
Quote: Originally Posted by JordanChris I can't see why (assume: MyRange is a string) any of those lines would give a "wrong number of arguments". Maybe this line is wrong??: For i =1 To all
By "insert" do you mean Add Attachment??
|
|

11-12-2003, 05:47 AM
|
|
Regular
|
|
Join Date: Oct 2003
Posts: 88
|
|
|
What exactly do you want to insert into the body of the email? I found a great macro that takes a specified range in excel and converts it to html (keeping all the formatting) and makes the html the body of the email. Are you looking for something like that? I think it would apply equally well to word files as long as they were saved as html files.
Galaganut
|
|

11-12-2003, 03:44 PM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
what exactly is a list with a number of rows and a number of columns,
in order to align all these preferably a table i guess
I can export these things to word, and if needs be to excel as well
Quote: Originally Posted by galaganut What exactly do you want to insert into the body of the email? I found a great macro that takes a specified range in excel and converts it to html (keeping all the formatting) and makes the html the body of the email. Are you looking for something like that? I think it would apply equally well to word files as long as they were saved as html files.
Galaganut
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Outlook 2000 Contact Items, Deleted items and Address Books
|
hitchhiker |
General |
0 |
10-14-2003 07:03 AM |
|
Sorting messages in Outlook 2000
|
CodeOptimist |
Word, PowerPoint, Outlook, and Other Office Products |
0 |
06-26-2003 10:32 PM |
|
New problem when import .CSV file which is exported by Outlook
|
LoveVB99 |
File I/O and Registry |
2 |
06-13-2003 12:15 AM |
|
Web server reboot and Outlook Objects
|
jdirienzi |
Word, PowerPoint, Outlook, and Other Office Products |
2 |
10-23-2002 08:02 AM |
|
Outlook XP and Word Editor question
|
hongman |
Word, PowerPoint, Outlook, and Other Office Products |
1 |
04-22-2002 07:00 PM |
|
|
|
|
|
 |
|