And just to be clear the fields are created and inside the form. They
are displayed in the "User-Defined Fields in Folder" folder and my
forms folder
Where they need to be present is in User-Defined Fields in This Item.
when I type into the Utility and CityState fields, the FileAs text box
doesn't update with the information
Code for the Item_Write event handler runs when you save the item. If you want the FileAs value to update when you type, that requires different events -- PropertyChange and CustomPropertyChange. Seehttp://
www.outlookcode.com/article.aspx?ID=38
On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"
Lots of problems here:
1) There is no FileAs event. You should use the Item_Write event handler.
2) There is no Utility standard property. Access custom properties through the UserProperties collection.
3) There is no CityState standard property. When in doubt, 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.
4) You don't need the parentheses in the Item.FileAs statement . Try:
Item.FileAs = Item.UserProperties("Utility") & vbcrlf & _
Item.City & " " & Item.State
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
I am creating a custom form with custom fields in outlook 2003.
The form that I am creating is a custom contact form. I want each
customer thats listed in this contact folder to be filed by the custom
fields that I created, Utility & CityState.
To do this i've tried adding the following formula to the form code:
Sub Item_FileAs
Item.FileAs = Item.Utility &vbcrlf " (" & Item.CityState & ")"
End Sub
To Display...
"Utilty
City State"
...In the gray area for the File As.
When I try to run the form, the form displayes this "9/21/2007 8:00:00
AM". Can someone help me figure out what's going on.- Hide quoted text -
- Show quoted text -
Ok so I tried:
Function Item_Write()
Item.FileAs = Item.UserProperties("Utility") & vbcrlf & _
Item.UserProperties("CityState")
End Function
It took away the date and displayed " ()" in the text box. However now
when I type into the Utility and CityState fields, the FileAs text box
doesn't update with the information- Hide quoted text -
- Show quoted text -