A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

TaskItem assignment



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 21st 09, 07:13 PM posted to microsoft.public.outlook.program_vba
MrBaseball34
external usenet poster
 
Posts: 2
Default TaskItem assignment

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[i]+'"');
// Is this required?
// Recipient.Resolve;
end;
// Do I save before I send?
TaskItem.Save;
TaskItem.Send;

Ads
  #2  
Old July 21st 09, 07:31 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default TaskItem assignment

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.

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


"MrBaseball34" wrote in message
...[i]
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;


  #3  
Old July 21st 09, 08:51 PM posted to microsoft.public.outlook.program_vba
MrBaseball34
external usenet poster
 
Posts: 2
Default TaskItem assignment

On Jul 21, 1:31*pm, "Ken Slovak - [MVP - Outlook]"
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?

  #4  
Old July 21st 09, 09:00 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default TaskItem assignment

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?

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


"MrBaseball34" wrote in message
...
On Jul 21, 1:31 pm, "Ken Slovak - [MVP - Outlook]"
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?

  #5  
Old July 21st 09, 09:06 PM posted to microsoft.public.outlook.program_vba
MB34
external usenet poster
 
Posts: 15
Default TaskItem assignment

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?
  #6  
Old July 21st 09, 09:12 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default TaskItem assignment

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

--
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" wrote in message
...
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?

  #7  
Old July 21st 09, 09:13 PM posted to microsoft.public.outlook.program_vba
MB34
external usenet poster
 
Posts: 15
Default TaskItem assignment

On Jul 21, 3:06*pm, MB34 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?


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?
  #8  
Old July 21st 09, 09:19 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default TaskItem assignment

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" wrote in message
...
On Jul 21, 3:06 pm, MB34 wrote:
snip

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

  #9  
Old July 21st 09, 09:43 PM posted to microsoft.public.outlook.program_vba
MB34
external usenet poster
 
Posts: 15
Default TaskItem assignment

On Jul 21, 3:19*pm, "Ken Slovak - [MVP - Outlook]"
wrote:
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" wrote in message

...
On Jul 21, 3:06 pm, MB34 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):






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?
  #10  
Old July 21st 09, 11:10 PM posted to microsoft.public.outlook.program_vba
MB34
external usenet poster
 
Posts: 15
Default TaskItem assignment

On Jul 21, 3:43*pm, MB34 wrote:
On Jul 21, 3:19*pm, "Ken Slovak - [MVP - Outlook]"



wrote:
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" wrote in message


....
On Jul 21, 3:06 pm, MB34 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):






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
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Category assignment Pavel Outlook - Calandaring 1 October 20th 08 03:17 AM
How to get Microsoft.Office.Interop.Outlook.TaskItem from the IUnknown (C#) Godandag Add-ins for Outlook 5 April 5th 07 09:39 AM
Outlook Task Assignment [email protected] Outlook - General Queries 3 April 3rd 07 07:26 PM
TaskItem and AppointmentItem formated body razvantim Outlook and VBA 10 November 10th 06 08:55 PM
contact form assignment jkos13 Outlook - Using Forms 1 March 3rd 06 07:07 PM


All times are GMT +1. The time now is 02:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.