how to print in task form fields from contats

G

Guest

Hello,

first of all, I am sorry for my poor english.
I made a form in tasks. Default outlook fields are printed by this:
oDoc.FormFields("Mileage").Result = CStr(Mileage)

My own fields are printed by this: strMyField =
Item.UserProperties.Find("field1.")
oDoc.FormFields("fieldA").Result = strMyField

In the task is filled contact. Iam beginner in VB and I found previous
commands on this site.Please, could you advise me, how to print fields from
contact (like telephone or adress) which is filled in the task ?

Thank you very much
 
H

Hollis Paul [MVP - Outlook]

In the task is filled contact. Iam beginner in VB and I found previous
commands on this site.Please, could you advise me, how to print fields from
contact (like telephone or adress) which is filled in the task ?
Look at these pages:

Syntax for Microsoft Outlook property and control values and events
5/10/2006
Correct syntax for accessing Microsoft Outlook property and control values
and writing events that respond to changes in properties or control values
http://www.outlookcode.com/d/propsyntax.htm - 31 KB

Printing Custom Microsoft Outlook Forms and Reports 5/10/2006
Techniques for printing custom reports from Microsoft Outlook, including copy
and paste to Excel, saved searches, third-party tools, and custom code
http://www.outlookcode.com/d/customprint.htm - 26 KB
 
S

Sue Mosher [MVP-Outlook]

You need to return the linked contact from the Links collection and get the desired property values from that contact.

On Error Resume Next
Set contact = Item.Links(1).Item
If Not contact Is Nothing Then
strPhone = contact.BusinessTelephoneNumber
' etc.
End If

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top