![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
I'm trying to write some VB code that pulls all of the control and field information out of an .oft file. The issue I'm having is that I would like to get at the DisplayFormat property of a field (UserProperty) that belongs to the item represented by the .oft (i.e., MailItem, PostItem). The .oft was created by someone at a different organization, so when my code calls CreateItemFromTemplate, I am unable to create the item in the folder where the UserDefinedProperties (folder fields) context would be available. I noticed that you can access the DisplayFormat via the UserDefinedProperty interface for a field that has been added to a folder, *BUT* it does not appear to be possible to get the DisplayFormat for a field (UserProperty) that only has the context of the item. I did a test where I created a field in the Outlook 2007 form designer, chose a type of numeric and a display format, and bound it to a control on a form. Then I deleted the field from the folder fields so that it was only stored in the item. I ran the form and the display format was still applied, even though the field now only resides within the item. So, it seems that the DisplayFormat info must still be stored somewhere at the item level, even though the field has been deleted from the folder level (UserDefinedProperties). The question is, is there a way to access the DisplayFormat info for an item field (UserProperty) programmatically? Thanks, Leslie McGann-Sturgeon |
Ads |
#2
|
|||
|
|||
![]()
Have you tried publishing that form to an appropriate folder and seeing if
the properties you want are there? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm wrote in message ... Hello, I'm trying to write some VB code that pulls all of the control and field information out of an .oft file. The issue I'm having is that I would like to get at the DisplayFormat property of a field (UserProperty) that belongs to the item represented by the .oft (i.e., MailItem, PostItem). The .oft was created by someone at a different organization, so when my code calls CreateItemFromTemplate, I am unable to create the item in the folder where the UserDefinedProperties (folder fields) context would be available. I noticed that you can access the DisplayFormat via the UserDefinedProperty interface for a field that has been added to a folder, *BUT* it does not appear to be possible to get the DisplayFormat for a field (UserProperty) that only has the context of the item. I did a test where I created a field in the Outlook 2007 form designer, chose a type of numeric and a display format, and bound it to a control on a form. Then I deleted the field from the folder fields so that it was only stored in the item. I ran the form and the display format was still applied, even though the field now only resides within the item. So, it seems that the DisplayFormat info must still be stored somewhere at the item level, even though the field has been deleted from the folder level (UserDefinedProperties). The question is, is there a way to access the DisplayFormat info for an item field (UserProperty) programmatically? Thanks, Leslie McGann-Sturgeon |
#3
|
|||
|
|||
![]()
Hi Ken,
Thanks for your response. I just tried publishing a test .oft file to a folder, and none of the fields from the oft appeared at the folder level after publishing. I'm new to Outlook, so I'm not sure what you mean by publishing it to an "appropriate" folder. Also, if I were to receive a batch of several hundred .oft files created at another organization, how would I know what "appropriate" folder to publish them to? Could each one have a different "appropriate" folder? At any rate, I would like to be able to get all of the information out of the .oft files programmatically, without having to perform any manual steps using the Outlook UI. It is too bad that there doesn't seem to be any way to get at several pieces of information associated with fields contained in an .oft file by using the API: - DisplayFormat - Whether the field is required to be filled in - Whether the field should be included for printing If you know of any way that I can get this info programmatically, I would be grateful if you could let me know. On Mar 30, 9:55*am, "Ken Slovak - [MVP - Outlook]" wrote: Have you tried publishing that form to an appropriate folder and seeing if the properties you want are there? -- Ken Slovak [MVP - Outlook]http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options.http://www.slovaktech.com/products.htm wrote in message ... Hello, I'm trying to write some VB code that pulls all of the control and field information out of an .oft file. *The issue I'm having is that I would like to get at the DisplayFormat property of a field (UserProperty) that belongs to the item represented by the .oft (i.e., MailItem, PostItem). The .oft was created by someone at a different organization, so when my code calls CreateItemFromTemplate, I am unable to create the item in the folder where the UserDefinedProperties (folder fields) context would be available. *I noticed that you can access the DisplayFormat via the UserDefinedProperty interface for a field that has been added to a folder, *BUT* it does not appear to be possible to get the DisplayFormat for a field (UserProperty) that only has the context of the item. I did a test where I created a field in the Outlook 2007 form designer, chose a type of numeric and a display format, and bound it to a control on a form. *Then I deleted the field from the folder fields so that it was only stored in the item. *I ran the form and the display format was still applied, even though the field now only resides within the item. *So, it seems that the DisplayFormat info must still be stored somewhere at the item level, even though the field has been deleted from the folder level (UserDefinedProperties). The question is, is there a way to access the DisplayFormat info for an item field (UserProperty) programmatically? Thanks, Leslie McGann-Sturgeon- Hide quoted text - - Show quoted text - |
#4
|
|||
|
|||
![]()
You at minimum have to create an item from an OFT to access it and any
available properties. An appropriate folder is one that holds that type of item, i.e a Contacts folder for contact items, Mail folder for email items, Tasks folder for task items, etc. Other than what you've tried and UserProperties in an item and any FormDescription properties for it there is no other way to access the properties of the item in the Outlook object model. You can get additional information using a lower level API such as Extended MAPI (C++ or Delphi only), or you can examine an item using a MAPI viewer such as MFCMAPI from MS or OutlookSpy (www.dimastr.com), but in many cases any such additional information is in undocumented binary properties so won't make much sense. If you are actually hiring people to create custom forms for you they should be supplying documentation and/or publishing the forms to a folder in a PST file so you have access to any folder as well as item properties. If you create an item from an OFT you can examine the properties of every control on the item to see what validations, etc. are applied. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm wrote in message ... Hi Ken, Thanks for your response. I just tried publishing a test .oft file to a folder, and none of the fields from the oft appeared at the folder level after publishing. I'm new to Outlook, so I'm not sure what you mean by publishing it to an "appropriate" folder. Also, if I were to receive a batch of several hundred .oft files created at another organization, how would I know what "appropriate" folder to publish them to? Could each one have a different "appropriate" folder? At any rate, I would like to be able to get all of the information out of the .oft files programmatically, without having to perform any manual steps using the Outlook UI. It is too bad that there doesn't seem to be any way to get at several pieces of information associated with fields contained in an .oft file by using the API: - DisplayFormat - Whether the field is required to be filled in - Whether the field should be included for printing If you know of any way that I can get this info programmatically, I would be grateful if you could let me know. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Searching Contacts on a UserProperty | McKilty | Outlook and VBA | 2 | February 26th 09 04:52 PM |
Adding a UserProperty to an item | melon | Outlook - Using Forms | 1 | December 9th 08 08:51 PM |
Iterating Through UserProperty Values | Henry Stockbridge | Outlook and VBA | 2 | June 22nd 08 08:35 PM |
Regarding outlook UserProperty | Bharathi | Add-ins for Outlook | 1 | October 12th 07 02:19 PM |
How to add a UserProperty to a MAPIFolder? | Jeff | Outlook and VBA | 4 | November 8th 06 10:10 PM |