PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Can't update or view custom fields
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Can't update or view custom fields
![]() |
Can't update or view custom fields |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
In Outlook 2003 I'm not able to list, update, or view custom fields that I
have created using the userproperies.add method. The custom fields appear in the "show fields" window in Outlook, but I can't access them in code. The following is supposed to list all fields in the calendar folder, including the custom fields; however, only the Outlook-defined fields show. What's wrong with my code?? Public Sub viewfields() Dim oolAppointmentItem As Outlook.AppointmentItem Dim oolItemProperties As Outlook.ItemProperties Dim oolItemProperty As Outlook.ItemProperty Dim molcalendarfolder As Outlook.MAPIFolder Set molcalendarfolder = pnspMAPI.GetDefaultFolder(olFolderCalendar) For Each oolAppointmentItem In molcalendarfolder.Items With oolAppointmentItem Set oolItemProperties = .ItemProperties For Each oolItemProperty In oolItemProperties Debug.Print oolItemProperty.Name, oolItemProperty.Value Next End With Stop Next End Sub |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Defining properties in a folder does not assign them to individual items in
that folder. The individual items will not contain a custom property unless either (a) a value has been set for the property or (b) the item was created with a custom form that includes the property in question. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "LW" <LW@discussions.microsoft.com> wrote in message news:2FB583EE-B62E-4927-B971-A3B6A92B0F78@microsoft.com... > In Outlook 2003 I'm not able to list, update, or view custom fields that I > have created using the userproperies.add method. The custom fields appear > in > the "show fields" window in Outlook, but I can't access them in code. The > following is supposed to list all fields in the calendar folder, including > the custom fields; however, only the Outlook-defined fields show. What's > wrong with my code?? > > Public Sub viewfields() > Dim oolAppointmentItem As Outlook.AppointmentItem > Dim oolItemProperties As Outlook.ItemProperties > Dim oolItemProperty As Outlook.ItemProperty > Dim molcalendarfolder As Outlook.MAPIFolder > Set molcalendarfolder = pnspMAPI.GetDefaultFolder(olFolderCalendar) > For Each oolAppointmentItem In molcalendarfolder.Items > With oolAppointmentItem > Set oolItemProperties = .ItemProperties > For Each oolItemProperty In oolItemProperties > Debug.Print oolItemProperty.Name, oolItemProperty.Value > Next > End With > Stop > Next > End Sub |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

