Sorry Sue, that was ocurring when I run the code in a VBA project.
My code looks like this:
Set myTask= Application.CreateItem(3)
myTask.Subject = "Subject"
myTask.DueDate = #17/09/2009#
myTask.Save
Item.Save
Set colLinks = myTask.Links
Set oLinks = colLinks.Add(Item)
Now the Add function isn´t the problem. I checked the colLinks count and the
add is happening, but I never see the task in the Activities tab.
Thanks.
"Sue Mosher [MVP]" wrote:
> Sorry, but I don't understand what you mean by "appears my custom form as a
> contact element."
> The Activities tab does an on-demand search each time you use it, which can
> be quite slow, depending on how many folders are included in the selected
> activity group. Maybe you just need to wait longer for the search to
> complete.
> > Sue Mosher
> > >
> "yannickestrada" <yannickestrada> wrote in message
> news:FE88A9FA-46FA-41A9-96AF-52E82C317E7E@microsoft.com...
> > Thanks Sue, that works.
> > But know I had 2 problems. The task doesn´t appear in the Activities tab
> > like I expected, instead appears my custom form as a contact element.
> > The other problem is that the elements in Activities tab sometimes appears
> > sometimes not. Why is that? I use Outlook 2007.
> > Regards
> > "Sue Mosher [MVP]" wrote:
> >
> >> Here's another idea: Try saving the item before you call Links.Add
> >
> >> "yannickestrada" <yannickestrada> wrote in
> >> message
> >> news:1F82F06C-3303-45C4-816A-6B7B4A6BEDCB@microsoft.com...
> >> > Same error. I don´t know what is the problem, because the Item is like
> >> > Item.Contact.MyForm, that should work.
> >> >> > Thanks again.
> >> >> > " - " 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)
> >> >
> >> >> "yannickestrada" <yannickestrada> wrote in
> >> >> message
> >> >> news:F77401BC-125F-4F45-8EFB-EA176FC86EBE@microsoft.com...
> >> >> >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.
> >> >
> >> >
> >
> >
> >>
>