PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming link.item

Reply

link.item

 
Thread Tools Rate Thread
Old 27-08-2004, 11:11 PM   #1
Paul Martin
Guest
 
Posts: n/a
Default link.item


Hi All

I have made a custom Task form and setup the registry so when you select
contact then new task for contact I get the custom form. I am trying to get
my head around the next bit. How to get a few fields automatically filled in
e.g. name, company, telephone etc. I think I can use link.item comands but
not sure how to go about it. Can anybody give me some suggestions.

Thanks
Paul


  Reply With Quote
Old 27-08-2004, 11:51 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: link.item

In the Item_Open event handler, you can return the ContactItem represented
by the first link with the expression Item.Links(1).Item. Once you ahve
that, do whatever you like with its data.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Paul Martin" <paul@fantasyprints.co.uk> wrote in message
news:O$vOVLIjEHA.592@TK2MSFTNGP11.phx.gbl...
> Hi All
>
> I have made a custom Task form and setup the registry so when you select
> contact then new task for contact I get the custom form. I am trying to
> get my head around the next bit. How to get a few fields automatically
> filled in e.g. name, company, telephone etc. I think I can use link.item
> comands but not sure how to go about it. Can anybody give me some
> suggestions.
>
> Thanks
> Paul
>



  Reply With Quote
Old 28-08-2004, 11:12 PM   #3
Paul Martin
Guest
 
Posts: n/a
Default Re: link.item

Hi Sue

> In the Item_Open event handler, you can return the ContactItem represented
> by the first link with the expression Item.Links(1).Item. Once you ahve
> that, do whatever you like with its data.


Thanks for the speedy reply. I have been reading your book and trying to
figure out how to do what you suggest . But I can't seem to get my head
around how to achieve what I want. I wonder if you could get me started. If
I wanted to get the FULLNAME from the contact I have just selected the
ACTION NEW TASK FOR CONTACT what would the coding look like? ...and if I
wanted to display this on the custom TASK FORM I have created.


Thanks
Paul


  Reply With Quote
Old 29-08-2004, 03:42 PM   #4
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: link.item

Function Item_Open()
If Item.Links.Count = 1 Then
Set objContact = Item.Links(1).Item
MsgBox objContact.FullName
End If
End Function

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Paul Martin" <paul@fantasyprints.co.uk> wrote in message
news:Oi3QzwUjEHA.1764@TK2MSFTNGP10.phx.gbl...
> Hi Sue
>
>> In the Item_Open event handler, you can return the ContactItem
>> represented by the first link with the expression Item.Links(1).Item.
>> Once you ahve that, do whatever you like with its data.

>
> Thanks for the speedy reply. I have been reading your book and trying to
> figure out how to do what you suggest . But I can't seem to get my head
> around how to achieve what I want. I wonder if you could get me started.
> If I wanted to get the FULLNAME from the contact I have just selected the
> ACTION NEW TASK FOR CONTACT what would the coding look like? ...and if I
> wanted to display this on the custom TASK FORM I have created.
>
>
> Thanks
> Paul
>



  Reply With Quote
Old 29-08-2004, 04:22 PM   #5
Paul Martin
Guest
 
Posts: n/a
Default Re: link.item

Hi Sue

Superb - thanks for that.

I can see how to get the particular fields I need e.g. Full Name, Company
address, etc but how do I get the fields I have created to be populated with
this information? E.g if I have created a field to Show the fullname how do
I fill it with the Fullname linked to the particular contact?

Its starting all to make sense

THanks
Paul


"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message
news:%23II6zRdjEHA.1712@TK2MSFTNGP09.phx.gbl...
> Function Item_Open()
> If Item.Links.Count = 1 Then
> Set objContact = Item.Links(1).Item
> MsgBox objContact.FullName
> End If
> End Function
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Paul Martin" <paul@fantasyprints.co.uk> wrote in message
> news:Oi3QzwUjEHA.1764@TK2MSFTNGP10.phx.gbl...
>> Hi Sue
>>
>>> In the Item_Open event handler, you can return the ContactItem
>>> represented by the first link with the expression Item.Links(1).Item.
>>> Once you ahve that, do whatever you like with its data.

>>
>> Thanks for the speedy reply. I have been reading your book and trying to
>> figure out how to do what you suggest . But I can't seem to get my head
>> around how to achieve what I want. I wonder if you could get me started.
>> If I wanted to get the FULLNAME from the contact I have just selected the
>> ACTION NEW TASK FOR CONTACT what would the coding look like? ...and if I
>> wanted to display this on the custom TASK FORM I have created.
>>
>>
>> Thanks
>> Paul
>>

>
>



  Reply With Quote
Old 29-08-2004, 10:05 PM   #6
Paul Martin
Guest
 
Posts: n/a
Default Re: link.item

Hi Sue

Think I am getting there but not sure in the right direction. I have found a
way to populate fields if I make them LISTBOXES and use the following code
Function Item_Open()

If Item.Links.Count = 1 Then

Set objContact = Item.Links(1).Item

Set Formpage = Item.GetInspector.ModifiedFormPages("Fantasy JOB")

Set Control = FormPage.Controls("CustomerContact")

Control.PossibleValues = objContact.FullName

End If

End Function

This works great for FULLNAME but I can't seem to get COMPANY NAME, ADDRESS,
TELEPHONE or EMAIL to work. I tried simply changing the FULLNAME to these
values to make sure I get the correct information but I just get errors.
What am I doing wrong?

Cheers

Paul

"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message
news:%23II6zRdjEHA.1712@TK2MSFTNGP09.phx.gbl...
> Function Item_Open()
> If Item.Links.Count = 1 Then
> Set objContact = Item.Links(1).Item
> MsgBox objContact.FullName
> End If
> End Function
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Paul Martin" <paul@fantasyprints.co.uk> wrote in message
> news:Oi3QzwUjEHA.1764@TK2MSFTNGP10.phx.gbl...
>> Hi Sue
>>
>>> In the Item_Open event handler, you can return the ContactItem
>>> represented by the first link with the expression Item.Links(1).Item.
>>> Once you ahve that, do whatever you like with its data.

>>
>> Thanks for the speedy reply. I have been reading your book and trying to
>> figure out how to do what you suggest . But I can't seem to get my head
>> around how to achieve what I want. I wonder if you could get me started.
>> If I wanted to get the FULLNAME from the contact I have just selected the
>> ACTION NEW TASK FOR CONTACT what would the coding look like? ...and if I
>> wanted to display this on the custom TASK FORM I have created.
>>
>>
>> Thanks
>> Paul
>>

>
>



  Reply With Quote
Old 29-08-2004, 10:24 PM   #7
Paul Martin
Guest
 
Posts: n/a
Default Re: link.item

Hi Sue

Found my problem. I am not using the correct LINK fields. Solved EMAIL now
looking for the Business Telephone and Address FIELD titles. Is there anyway
of seeing what these are? At the moment I am searching websites (yours
mainly1) for their names.

Thanks
Paul


"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message
news:%23II6zRdjEHA.1712@TK2MSFTNGP09.phx.gbl...
> Function Item_Open()
> If Item.Links.Count = 1 Then
> Set objContact = Item.Links(1).Item
> MsgBox objContact.FullName
> End If
> End Function
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Paul Martin" <paul@fantasyprints.co.uk> wrote in message
> news:Oi3QzwUjEHA.1764@TK2MSFTNGP10.phx.gbl...
>> Hi Sue
>>
>>> In the Item_Open event handler, you can return the ContactItem
>>> represented by the first link with the expression Item.Links(1).Item.
>>> Once you ahve that, do whatever you like with its data.

>>
>> Thanks for the speedy reply. I have been reading your book and trying to
>> figure out how to do what you suggest . But I can't seem to get my head
>> around how to achieve what I want. I wonder if you could get me started.
>> If I wanted to get the FULLNAME from the contact I have just selected the
>> ACTION NEW TASK FOR CONTACT what would the coding look like? ...and if I
>> wanted to display this on the custom TASK FORM I have created.
>>
>>
>> Thanks
>> Paul
>>

>
>



  Reply With Quote
Old 29-08-2004, 10:58 PM   #8
Paul Martin
Guest
 
Posts: n/a
Default Re: link.item

Hi Sue

Success and not

I got all the fields to work and now I can get exactly what I want problem
is I was using the same contact all the time to test form. But if I select a
different contact and ACTION NEW TASK FOR CONTACT none of the fields are
filled in. Can you have a look and see what I have done wrong. Going back to
the original contact and form works great.
Function Item_Open()

If Item.Links.Count = 1 Then

Set Formpage = Item.GetInspector.ModifiedFormPages("Fantasy JOB")

Set objContact = Item.Links(1).Item

Set objInsp = Item.GetInspector

Set Control = FormPage.Controls("CustomerContact")

Control.PossibleValues = objContact.FullName

Set Control2 = FormPage.Controls("Email")

Control2.PossibleValues = objContact.IMAddress

Set Control3 = FormPage.Controls("Telephone")

Control3.PossibleValues = objContact.BusinessTelephoneNumber

Set Control4 = FormPage.Controls("Street")

Control4.PossibleValues = objContact.BusinessAddressStreet

Set Control5 = FormPage.Controls("Company")

Control5.PossibleValues = objContact.CompanyName

Set Control6 = FormPage.Controls("Town")

Control6.PossibleValues = objContact.BusinessAddressCity

Set Control7 = FormPage.Controls("County")

Control7.PossibleValues = objContact.BusinessAddressState

Set Control8 = FormPage.Controls("Postcode")

Control8.PossibleValues = objContact.BusinessAddressPostalCode

End If

End Function



"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message
news:%23II6zRdjEHA.1712@TK2MSFTNGP09.phx.gbl...
> Function Item_Open()
> If Item.Links.Count = 1 Then
> Set objContact = Item.Links(1).Item
> MsgBox objContact.FullName
> End If
> End Function
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Paul Martin" <paul@fantasyprints.co.uk> wrote in message
> news:Oi3QzwUjEHA.1764@TK2MSFTNGP10.phx.gbl...
>> Hi Sue
>>
>>> In the Item_Open event handler, you can return the ContactItem
>>> represented by the first link with the expression Item.Links(1).Item.
>>> Once you ahve that, do whatever you like with its data.

>>
>> Thanks for the speedy reply. I have been reading your book and trying to
>> figure out how to do what you suggest . But I can't seem to get my head
>> around how to achieve what I want. I wonder if you could get me started.
>> If I wanted to get the FULLNAME from the contact I have just selected the
>> ACTION NEW TASK FOR CONTACT what would the coding look like? ...and if I
>> wanted to display this on the custom TASK FORM I have created.
>>
>>
>> Thanks
>> Paul
>>

>
>



  Reply With Quote
Old 30-08-2004, 01:20 PM   #9
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: link.item

No, that won't work. Use:

Item.UserProperties("propname") = "some value"

See http://www.outlookcode.com/d/propsyntax.htm for more Outlook form syntax
basics.

When in doubt about the exact name of a property, check the object browser:
Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch
from <All Libraries> to Outlook to browse all Outlook objects and their
properties, methods, and events. Select any object or member, then press F1
to see its Help topic.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Paul Martin" <paul@fantasyprints.co.uk> wrote in message
news:%23N2LGwgjEHA.1652@TK2MSFTNGP09.phx.gbl...
> Hi Sue
>
> Think I am getting there but not sure in the right direction. I have found
> a way to populate fields if I make them LISTBOXES and use the following
> code
> Function Item_Open()
>
> If Item.Links.Count = 1 Then
>
> Set objContact = Item.Links(1).Item
>
> Set Formpage = Item.GetInspector.ModifiedFormPages("Fantasy JOB")
>
> Set Control = FormPage.Controls("CustomerContact")
>
> Control.PossibleValues = objContact.FullName
>
> End If
>
> End Function
>



  Reply With Quote
Old 30-08-2004, 01:29 PM   #10
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: link.item

Did you make your task form the default for all tasks? If not, New Task for
Contact will bring up the standard task form. See
http://www.outlookcode.com/d/newdef...m#changedefault .
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Paul Martin" <paul@fantasyprints.co.uk> wrote in message
news:OVTA3NhjEHA.3896@TK2MSFTNGP10.phx.gbl...
> Hi Sue
>
> Success and not
>
> I got all the fields to work and now I can get exactly what I want problem
> is I was using the same contact all the time to test form. But if I select
> a different contact and ACTION NEW TASK FOR CONTACT none of the fields are
> filled in. Can you have a look and see what I have done wrong. Going back
> to the original contact and form works great.



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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