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

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hi Sue
>
[quoted text clipped - 11 lines]
> Thanks
> Paul
Paul Martin - 29 Aug 2004 16:22 GMT
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
> Function Item_Open()
> If Item.Links.Count = 1 Then
[quoted text clipped - 18 lines]
>> Thanks
>> Paul
Paul Martin - 29 Aug 2004 22:05 GMT
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
> Function Item_Open()
> If Item.Links.Count = 1 Then
[quoted text clipped - 18 lines]
>> Thanks
>> Paul
Sue Mosher [MVP-Outlook] - 30 Aug 2004 13:20 GMT
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.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hi Sue
>
[quoted text clipped - 16 lines]
>
> End Function
Paul Martin - 30 Aug 2004 15:29 GMT
Hi Sue
Thanks for that. Redid form and worked great but still hit a problem
mentioned below. If I test the form on a contact I get the fields filled in
no problem. But as soon as I try another contact I still get the custom form
but the fields not filled in.
Below is the code I have now used on the form. Is there a bit missing?
Function Item_Open()
If Item.Links.Count = 1 Then
Set objContact = Item.Links(1).Item
Set Formpage = Item.GetInspector.ModifiedFormPages("Fantasy JOB")
Item.UserProperties("CustomerContact") = objContact.FullName
Item.UserProperties("Telephone") = objContact.BusinessTelephoneNumber
Item.UserProperties("Email") = objContact.Email1Address
Item.UserProperties("CompanyName") = objContact.CompanyName
Item.UserProperties("AddressStreet") = objContact.BusinessAddressStreet
Item.UserProperties("AddressCity") = objContact.BusinessAddressCity
Item.UserProperties("AddressState") = objContact.BusinessAddressState
Item.UserProperties("AddressPostCode") =
objContact.BusinessAddressPostalCode
End If
End Function
Cheers
Paul
> No, that won't work. Use:
>
[quoted text clipped - 29 lines]
>>
>> End Function
Paul Martin - 30 Aug 2004 15:33 GMT
Hi Sue
If I remove
If Item.Links.Count = 1 Then
End If
I always get the test contacts details filled in on the task if I select NEW
TASK FOR CONTACT using any other contact.
If I add these lines back in get correct details for test contact but blank
for all other contacts.
Hope helps
Paul
> Hi Sue
>
[quoted text clipped - 70 lines]
>>>
>>> End Function
Paul Martin - 30 Aug 2004 15:48 GMT
Hi Sue
Stopped working again :( Now no contact fills in the form Its like the form
when created from the NEW TASK FOR CONTACT has a setting preventing it
linking to the contact and therefore no fields filling in?
Paul
> Hi Sue
>
[quoted text clipped - 86 lines]
>>>>
>>>> End Function
Paul Martin - 01 Sep 2004 21:51 GMT
Hi Sue
SOlved the problem. It was staring me in the face. WHat I must have been
doing is trying the new task for contact. When the task appeared for the
contact selecting design this form and then resaving. There must be link
info saved with the form so it no longer links again.
Thanks for help
Paul
> No, that won't work. Use:
>
[quoted text clipped - 29 lines]
>>
>> End Function
Paul Martin - 29 Aug 2004 22:24 GMT
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
> Function Item_Open()
> If Item.Links.Count = 1 Then
[quoted text clipped - 18 lines]
>> Thanks
>> Paul
Paul Martin - 29 Aug 2004 22:58 GMT
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
> Function Item_Open()
> If Item.Links.Count = 1 Then
[quoted text clipped - 18 lines]
>> Thanks
>> Paul
Sue Mosher [MVP-Outlook] - 30 Aug 2004 13:29 GMT
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/newdefaultform.htm#changedefault .

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hi Sue
>
[quoted text clipped - 5 lines]
> filled in. Can you have a look and see what I have done wrong. Going back
> to the original contact and form works great.