View Single Post
  #7  
Old July 28th 09, 02:00 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Creating a Task with VBScript

Here's another idea: Try saving the item before you call Links.Add

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"yannickestrada" wrote in message
...
Same error. I donīt know what is the problem, because the Item is like
Item.Contact.MyForm, that should work.

Thanks again.

"Ken Slovak - [MVP - Outlook]" wrote:

Item should work if the item is a contact item. Form code is VBScript, so
it
only has Variant objects and you can't create a ContactItem reference.

Does it work if you use it as a function:

Set colLinks = myTask.Links
Set oLink = colLinks.Add(Item)

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


"yannickestrada" wrote in
message
...
I get the error when I call: colLinks.Add(Item)



"yannickestrada" wrote:

Thanks I was traying to do the opposite.

But my new code doesnīt seems to work neither.

Set myTask = Application.CreateItem(3)
myTask.Subject = "..."
myTask.DueDate #17/08/09#

myTask.Save

Set colLinks = myTask.Links
colLinks.Add(Item)

How I get the current form as a ContactItem is not enough with Item?

Regards.





Ads