TaskItem assignment

M

MrBaseball34

I am trying to assign a TaskItem to multiple users and having some
difficulty figuring out if I'm doing the steps correctly. I am using
Delphi so, please, don't gag it should all work the same. I'm almost
done with this project
and this is the last sticking point. Please help...


// pmOutlook is my created Outlook COM instance
TaskItem := pmOutlook.CreateItem( olTaskItem );
// Assign properties here
TaskItem.Assign;
// slUserAddrs is a stringlist (similar to an array)
// that has the recipient's email addresses
for i := 0 to slUserAddrs.Count -1 do
begin
Recipient := TaskItem.Recipients.Add('"'+slUserAddrs+'"');
// Is this required?
// Recipient.Resolve;
end;
// Do I save before I send?
TaskItem.Save;
TaskItem.Send;
 
K

Ken Slovak - [MVP - Outlook]

You don't have to save first, sending will do that. I'd add a subject and
due date at minimum also though before sending.
 
M

MrBaseball34

You don't have to save first, sending will do that. I'd add a subject and
due date at minimum also though before sending.

Already doing that, I just commented them out like this:

// Assign properties here

I keep getting a dialog box that says:
"Outlook does not recognize one or more names."

I *know* that the email addresses are correct because I checked them.
Do I need to use the names and call Resolve?
 
K

Ken Slovak - [MVP - Outlook]

I'd definitely resolve them all and if necessary check the resolution on
each one. It won't send if one of the names won't resolve. Are you using
actual email addresses or names that should resolve from Contacts or a GAL?




You don't have to save first, sending will do that. I'd add a subject and
due date at minimum also though before sending.

Already doing that, I just commented them out like this:

// Assign properties here

I keep getting a dialog box that says:
"Outlook does not recognize one or more names."

I *know* that the email addresses are correct because I checked them.
Do I need to use the names and call Resolve?
 
M

MB34

You don't have to save first, sending will do that. I'd add a subject and
I'd definitely resolve them all and if necessary check the resolution on
each one. It won't send if one of the names won't resolve. Are you using
actual email addresses or names that should resolve from Contacts or a GAL?

I am using real email addresses that are stored in our DB but are also
assigned to the recipients as one of the smtp addresses in their
Outlook Properties.

If Resolve returns False, how can I figure out what the problem was?
 
K

Ken Slovak - [MVP - Outlook]

That's a tough one. Outlook only looks at the format of something if it's an
email address rather than a name. A name it will try to resolve to a contact
or GAL entry email address. In general it's looking just for the usual
"characters" + "@" + "characters" + "." + "characters" (in other words just
normal SMTP type formatting. Make sure no unprintable characters are there
or things like nulls (Char(0)).




<snip>

I am using real email addresses that are stored in our DB but are also
assigned to the recipients as one of the smtp addresses in their
Outlook Properties.

If Resolve returns False, how can I figure out what the problem was?
 
M

MB34

I am using real email addresses that are stored in our DB but are also
assigned to the recipients as one of the smtp addresses in their
Outlook Properties.

If Resolve returns False, how can I figure out what the problem was?

Seems to happen when I use a correct name as well. Do they have to be
exact matches?
 
K

Ken Slovak - [MVP - Outlook]

Yes, exact matches and if there are duplicates that can throw things off
too.




<snip>

Seems to happen when I use a correct name as well. Do they have to be
exact matches?
 
M

MB34

Yes, exact matches and if there are duplicates that can throw things off
too.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm


<snip>

Seems to happen when I use a correct name as well. Do they have to be
exact matches?

We have several smtp addresses for each user, like this (we own all
the different domain names):

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)

I know the users I'm selecting to send the task to have email
addresses in the DB that match one of the
smtp addresses in the GAL.
Resolve always seems to return false. Is there any way to get any
error info about why ti returned False?
 
M

MB34

Yes, exact matches and if there are duplicates that can throw things off
too.
--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm
"MB34" <[email protected]> wrote in message
Seems to happen when I use a correct name as well. Do they have to be
exact matches?

We have several smtp addresses for each user, like this (we own all
the different domain names):

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)

I know the users I'm selecting to send the task to have email
addresses in the DB that match one of the
smtp addresses in the GAL.
Resolve always seems to return false. Is there any way to get any
error info about why ti returned False?

Looks like enclosing the email addresses in double quotes was the
culprit.
Thanks for the help, though...

MB34
 

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