P
Ptit Dark
Hi,
In outlook, I have a function which
- look at the selected email(s)
- launches access to get generate one pdf by selected email(s). I save the
pdf(s) on a server.
- from access, I generate new email(s) with the title according the selected
email(s) (the title contains the client name), add the right pdf as an
attachment and save the email.
- back in my outlook function, I send all email in drafts (if I send then
via access, I have a annoying message which makes me wait a few seconds
before I'm allowed to say "Yes, I want to send the emails"
- then I search one by one the email(s) sent and save the email on a server
in a directory related to the client.
This is were the problem begins : the code seems to block the sending of the
email(s) and since I search the email(s) in the sent items, the search gets
no result and my email is not found. When the code stops while I'm debugging,
the email is sent and when I resume the execution, the search gets the email
and the code saves the email.
I tried to make a pause in the execution of the code with a sleep function
(something that loops until the delay is expired) but while code is running,
the email isn't sent.
I guess, I have to get no code running between the time the email is sent
and when I try to save it.
So I have a few question :
- Is there an event when an email is sent just like Application_NewEmail?
Because Application_ItemSend takes place just before the email is sent. Or
can we trigger when a new email "appears" in the send folder?
- Is it possible to select an email when knowing its title and it's in the
sent item?
-
In outlook, I have a function which
- look at the selected email(s)
- launches access to get generate one pdf by selected email(s). I save the
pdf(s) on a server.
- from access, I generate new email(s) with the title according the selected
email(s) (the title contains the client name), add the right pdf as an
attachment and save the email.
- back in my outlook function, I send all email in drafts (if I send then
via access, I have a annoying message which makes me wait a few seconds
before I'm allowed to say "Yes, I want to send the emails"
- then I search one by one the email(s) sent and save the email on a server
in a directory related to the client.
This is were the problem begins : the code seems to block the sending of the
email(s) and since I search the email(s) in the sent items, the search gets
no result and my email is not found. When the code stops while I'm debugging,
the email is sent and when I resume the execution, the search gets the email
and the code saves the email.
I tried to make a pause in the execution of the code with a sleep function
(something that loops until the delay is expired) but while code is running,
the email isn't sent.
I guess, I have to get no code running between the time the email is sent
and when I try to save it.
So I have a few question :
- Is there an event when an email is sent just like Application_NewEmail?
Because Application_ItemSend takes place just before the email is sent. Or
can we trigger when a new email "appears" in the send folder?
- Is it possible to select an email when knowing its title and it's in the
sent item?
-