A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

FileAs Custom Property



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 21st 07, 06:41 PM posted to microsoft.public.outlook.program_forms
Cass
external usenet poster
 
Posts: 31
Default FileAs Custom Property

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.

Ads
  #2  
Old September 21st 07, 07:37 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default FileAs Custom Property

Lots of problems he

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


"Cass" wrote in message ups.com...
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.

  #3  
Old September 21st 07, 07:47 PM posted to microsoft.public.outlook.program_forms
Cass
external usenet poster
 
Posts: 31
Default FileAs Custom Property

On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"
wrote:
Lots of problems he

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



"Cass" wrote in oglegroups.com...
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

  #4  
Old September 21st 07, 07:49 PM posted to microsoft.public.outlook.program_forms
Cass
external usenet poster
 
Posts: 31
Default FileAs Custom Property

On Sep 21, 1:47 pm, Cass wrote:
On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"





wrote:
Lots of problems he


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


"Cass" wrote in oglegroups.com...
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 -


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

  #5  
Old September 21st 07, 07:56 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default FileAs Custom Property

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. See http://www.outlookcode.com/article.aspx?ID=38

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Cass" wrote in message ups.com...
On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"
wrote:
Lots of problems he

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



"Cass" wrote in oglegroups.com...
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

  #6  
Old September 21st 07, 09:43 PM posted to microsoft.public.outlook.program_forms
Cass
external usenet poster
 
Posts: 31
Default FileAs Custom Property

On Sep 21, 1:56 pm, "Sue Mosher [MVP-Outlook]"
wrote:
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

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"Cass" wrote in oglegroups.com...
On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"
wrote:
Lots of problems he


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


"Cass" wrote in oglegroups.com...
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 -


Thanks so much for your help so far...

You'll have to excuse me but that code throws me completely off...

From this:

Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "MyProp1"
strMyProp1 = Item.UserProperties("MyProp1")
Select Case strMyProp1
Case "Text1"
' code to react to the MyProp1
' string property having a value of "Text1"
Case "Text2"
' code to react to the MyProp1
' string property having a value of "Text2"
Case Else
' code to handle other values of MyProp1
End Select
Case "MyProp2"
' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor
End Select
End Sub



I interpretted this by putting some other codes together that i'd
found:
Sub Item_CustomPropertyChange(FileAs)
Select Case Name
Case "Utility"
strUtility=Item.UserProperties("Utilities")
Select Case strUtility
Case "Text1"
If Item.UserProperties.Find("Utility") "" Then
If Item.UserProperties.Find("Utility") "" Then
Item.UserProperties.Find("Utility") & " (" &
Item.UserProperties.Find("Utility") & ")"
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
End Select
EndSub

Function Item_Write()
Item.FileAs = Item.UserProperties.Find("Utility") & vbcrlf & _
Item.UserProperties.Find("CityState")
End Function






And don't get me started on the PropertyChange code. I know this is
not right, not only because it didn't work but because I have no idea
how to code this. Could you help me to figure this out? Thanks!

  #7  
Old September 21st 07, 10:39 PM posted to microsoft.public.outlook.program_forms
Cass
external usenet poster
 
Posts: 31
Default FileAs Custom Property

On Sep 21, 3:43 pm, Cass wrote:
On Sep 21, 1:56 pm, "Sue Mosher [MVP-Outlook]"





wrote:
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


--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Cass" wrote in oglegroups.com...
On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"
wrote:
Lots of problems he


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


"Cass" wrote in oglegroups.com...
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 -


Thanks so much for your help so far...

You'll have to excuse me but that code throws me completely off...

From this:


Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "MyProp1"
strMyProp1 = Item.UserProperties("MyProp1")
Select Case strMyProp1
Case "Text1"
' code to react to the MyProp1
' string property having a value of "Text1"
Case "Text2"
' code to react to the MyProp1
' string property having a value of "Text2"
Case Else
' code to handle other values of MyProp1
End Select
Case "MyProp2"
' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor
End Select
End Sub

I interpretted this by putting some other codes together that i'd
found:
Sub Item_CustomPropertyChange(FileAs)
Select Case Name
Case "Utility"
strUtility=Item.UserProperties("Utilities")
Select Case strUtility
Case "Text1"
If Item.UserProperties.Find("Utility") "" Then
If Item.UserProperties.Find("Utility") "" Then
Item.UserProperties.Find("Utility") & " (" &
Item.UserProperties.Find("Utility") & ")"
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
End Select
EndSub

Function Item_Write()
Item.FileAs = Item.UserProperties.Find("Utility") & vbcrlf & _
Item.UserProperties.Find("CityState")
End Function

And don't get me started on the PropertyChange code. I know this is
not right, not only because it didn't work but because I have no idea
how to code this. Could you help me to figure this out? Thanks!- Hide quoted text -

- Show quoted text -


Nevermind. After thinking a bit I realized they don't really need to
see the FileAsField. Thanks SO much for your help!

  #8  
Old September 21st 07, 11:03 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default FileAs Custom Property

What in particular throws you off? I've made your code more readable and annotated the obvious problems:

Sub Item_CustomPropertyChange(FileAs)
' #1: Never change the event procedure signature.
' Leave the parameter as Name, so that it matches
' the Select Case statement.
Select Case Name
Case "Utility"
' #3: If the name of the property that changes is Utility,
' why is this statement using "Utilities". You must
' use property names consistently.
strUtility=Item.UserProperties("Utilities")
Select Case strUtility
Case "Text1"
' #4: You have the same If ... Then expression twice.
If Item.UserProperties.Find("Utility") "" Then
If Item.UserProperties.Find("Utility") "" Then
' #5: The next statement is an expression, not a complete code
' statement. I'm not sure what you were trying to do with it.
Item.UserProperties.Find("Utility") & " (" & Item.UserProperties.Find("Utility") & ")"
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
End Select
End Sub

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Cass" wrote in message oups.com...
On Sep 21, 1:56 pm, "Sue Mosher [MVP-Outlook]"
wrote:
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



"Cass" wrote in oglegroups.com...
On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"
wrote:
Lots of problems he


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


"Cass" wrote in oglegroups.com...
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 -


Thanks so much for your help so far...

You'll have to excuse me but that code throws me completely off...

From this:

Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "MyProp1"
strMyProp1 = Item.UserProperties("MyProp1")
Select Case strMyProp1
Case "Text1"
' code to react to the MyProp1
' string property having a value of "Text1"
Case "Text2"
' code to react to the MyProp1
' string property having a value of "Text2"
Case Else
' code to handle other values of MyProp1
End Select
Case "MyProp2"
' code to handle a change in MyProp2 goes here

' continue with Case statements for other properties
' whose values you want to monitor
End Select
End Sub



I interpretted this by putting some other codes together that i'd
found:
Sub Item_CustomPropertyChange(FileAs)
Select Case Name
Case "Utility"
strUtility=Item.UserProperties("Utilities")
Select Case strUtility
Case "Text1"
If Item.UserProperties.Find("Utility") "" Then
If Item.UserProperties.Find("Utility") "" Then
Item.UserProperties.Find("Utility") & " (" &
Item.UserProperties.Find("Utility") & ")"
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
End Select
EndSub

Function Item_Write()
Item.FileAs = Item.UserProperties.Find("Utility") & vbcrlf & _
Item.UserProperties.Find("CityState")
End Function






And don't get me started on the PropertyChange code. I know this is
not right, not only because it didn't work but because I have no idea
how to code this. Could you help me to figure this out? Thanks!

  #9  
Old September 24th 07, 02:45 PM posted to microsoft.public.outlook.program_forms
Cass
external usenet poster
 
Posts: 31
Default FileAs Custom Property

On Sep 21, 5:03 pm, "Sue Mosher [MVP-Outlook]"
wrote:
What in particular throws you off? I've made your code more readable and annotated the obvious problems:

Sub Item_CustomPropertyChange(FileAs)
' #1: Never change the event procedure signature.
' Leave the parameter as Name, so that it matches
' the Select Case statement.
Select Case Name
Case "Utility"
' #3: If the name of the property that changes is Utility,
' why is this statement using "Utilities". You must
' use property names consistently.
strUtility=Item.UserProperties("Utilities")
Select Case strUtility
Case "Text1"
' #4: You have the same If ... Then expression twice.
If Item.UserProperties.Find("Utility") "" Then
If Item.UserProperties.Find("Utility") "" Then
' #5: The next statement is an expression, not a complete code
' statement. I'm not sure what you were trying to do with it.
Item.UserProperties.Find("Utility") & " (" & Item.UserProperties.Find("Utility") & ")"
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
End Select
End Sub

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"Cass" wrote in ooglegroups.com...
On Sep 21, 1:56 pm, "Sue Mosher [MVP-Outlook]"
wrote:
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


"Cass" wrote in oglegroups.com...
On Sep 21, 1:37 pm, "Sue Mosher [MVP-Outlook]"
wrote:
Lots of problems he


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


"Cass" wrote in oglegroups.com...
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 -


Thanks so much for your help so far...


You'll have to excuse me but that code throws me completely off...


From this:

Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "MyProp1"
strMyProp1 = Item.UserProperties("MyProp1")
Select Case strMyProp1
Case "Text1"
' code to react to the MyProp1
' string property having a value of "Text1"
Case "Text2"
' code to react to the MyProp1
' string property having a value of "Text2"
Case Else
' code to handle other values of MyProp1
End Select
Case "MyProp2"
' code to handle a change in MyProp2 goes here


' continue with Case statements for other properties
' whose values you want to monitor
End Select
End Sub


I interpretted this by putting some other codes together that i'd
found:
Sub Item_CustomPropertyChange(FileAs)
Select Case Name
Case "Utility"
strUtility=Item.UserProperties("Utilities")
Select Case strUtility
Case "Text1"
If Item.UserProperties.Find("Utility") "" Then
If Item.UserProperties.Find("Utility") "" Then
Item.UserProperties.Find("Utility") & " (" &
Item.UserProperties.Find("Utility") & ")"
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
Else
Item.FileAs = Item.UserProperties.Find("Utility")
End If
End Select
EndSub


Function Item_Write()
Item.FileAs = Item.UserProperties.Find("Utility") & vbcrlf & _
Item.UserProperties.Find("CityState")
End Function


And don't get me started on the PropertyChange code. I know this is
not right, not only because it didn't work but because I have no idea
how to code this. Could you help me to figure this out? Thanks!- Hide quoted text -


- Show quoted text -


What threw me off was the page that you sent me to for the most part
just told you where code needed to be so if you're not a programmer
figuring out how to translate that into what you need is hard. The
code I did really had no logic to it other than just trying to figure
out what to do.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DASL Filter on custom property Jeff Graves Add-ins for Outlook 0 April 8th 07 05:58 AM
cannot find an item according to Categories or Custom property Johny Outlook - Using Forms 0 November 29th 06 09:52 PM
WebPage/FileAs fields on custom contacts form Wolfgang Kais Outlook - Using Forms 3 October 10th 06 08:04 PM
Pocket Outlook Contact Custom Property and Active Sync jmsoftware Outlook - Using Forms 0 October 4th 06 10:23 PM
How to validate a Custom Property Page Jack Zhang Add-ins for Outlook 1 February 9th 06 08:22 PM


All times are GMT +1. The time now is 08:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.