TaskItem assignment

Status
Not open for further replies.
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;
 
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.

"MrBaseball34" <mrbaseball34@gmail.com> wrote in message

news:b15d1ffb-0ff5-4178-872f-a1d9c1442c6c@o7g2000yqb.googlegroups.com...
> 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;
>
 
On Jul 21, 1:31 pm, "
<kenslo...@mvps.org> wrote:
> 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?
 
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?

"MrBaseball34" <mrbaseball34@gmail.com> wrote in message

news:9b6e878f-d481-4e50-8317-1988c3809abc@b15g2000yqd.googlegroups.com...

On Jul 21, 1:31 pm, "
<kenslo...@mvps.org> wrote:
> 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?
 
> > 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?


> 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?
 
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)).

"MB34" <mrbaseball34@hotmail.com> wrote in message

news:97cd5afb-07d5-49d6-a896-5246dbc9ec97@v2g2000vbb.googlegroups.com...

<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?
 
On Jul 21, 3:06 pm, MB34 <mrbasebal...@hotmail.com> wrote:
> > > You don't have to save first, sending will do that. I'd add a subjectand
> > > 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?

>
> > 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?


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

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

too.

"MB34" <mrbaseball34@hotmail.com> wrote in message

news:717c4fb5-9d44-494d-b206-4cef5b4816b5@c14g2000yqm.googlegroups.com...

On Jul 21, 3:06 pm, MB34 <mrbasebal...@hotmail.com> wrote:

<snip
Seems to happen when I use a correct name as well. Do they have to be

exact matches?
 
On Jul 21, 3:19 pm, "
<kenslo...@mvps.org> wrote:
> Yes, exact matches and if there are duplicates that can throw things off
> too.

> >

> http://www.slovaktech.com

> "MB34" <mrbasebal...@hotmail.com> wrote in message

> news:717c4fb5-9d44-494d-b206-4cef5b4816b5@c14g2000yqm.googlegroups.com...
> On Jul 21, 3:06 pm, MB34 <mrbasebal...@hotmail.com> wrote:
> <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):

joe@com-pany.com

joe@company.com

joe@company.net

joe@company.org

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?
 
On Jul 21, 3:43 pm, MB34 <mrbasebal...@hotmail.com> wrote:
> On Jul 21, 3:19 pm, "
> <kenslo...@mvps.org> wrote:
> > Yes, exact matches and if there are duplicates that can throw things off
> > too.

>
> > > >

> > http://www.slovaktech.com
> >

>
> > "MB34" <mrbasebal...@hotmail.com> wrote in message

>
> >news:717c4fb5-9d44-494d-b206-4cef5b4816b5@c14g2000yqm.googlegroups.com....
> > On Jul 21, 3:06 pm, MB34 <mrbasebal...@hotmail.com> wrote:
> > <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):

> j...@com-pany.com
> j...@company.com
> j...@company.net
> j...@company.org

> 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
 
Status
Not open for further replies.

Similar threads

Back
Top