![]() |
UserProperties Date/Time format
I have a lot of date/time fields in a public folder and its corresponding
form, formatted as "9/22/2006" or "8:24 AM" depending on their application and user preference. These formats hold within the form, but if I populate a Word doc's bookmarks using UserProperties, they are all formatted as "9/22/2006 8:24:00 AM" which makes a big ugly mess. I can use FormatDateTime( ) on the UserProperties, but it does not offer a good solution for time. vbShortTime format is military time. vbLongTime includes the seconds, which I don't want either. It would seem I'm faced with these choices: Pull the display values from the form controls instead of the UserProperties. Doing string manipulation on the UserProperties to obtain time strings like "8:24 AM" Redo the Word template with Form fields formatted as desired (would this even work?) . Are there other simpler approaches? Thanks, Bill Le May |
UserProperties Date/Time format
Write your own function to produce the desired format, using standard functions like Month() and Day() to return each date/time part.
Formatting the Word fields might be worth trying. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Bill" wrote in message ... I have a lot of date/time fields in a public folder and its corresponding form, formatted as "9/22/2006" or "8:24 AM" depending on their application and user preference. These formats hold within the form, but if I populate a Word doc's bookmarks using UserProperties, they are all formatted as "9/22/2006 8:24:00 AM" which makes a big ugly mess. I can use FormatDateTime( ) on the UserProperties, but it does not offer a good solution for time. vbShortTime format is military time. vbLongTime includes the seconds, which I don't want either. It would seem I'm faced with these choices: Pull the display values from the form controls instead of the UserProperties. Doing string manipulation on the UserProperties to obtain time strings like "8:24 AM" Redo the Word template with Form fields formatted as desired (would this even work?) . Are there other simpler approaches? Thanks, Bill Le May |
UserProperties Date/Time format
"Hollis Paul [MVP - Outlook]" wrote...
As far as I know there are no simple solutions to this. I don't think getting the values from the controls will produce anything different. Actually the Text property of the control gives me what I want: Set objPage = Item.GetInspector.ModifiedFormPages("Travelers") Set txtControl = objPage.Controls("txtTraveler1DepartTime") strTime = txtControl.Text Thanks, Hollis. |
UserProperties Date/Time format
In article , Bill wrote:
Are there other simpler approaches? As far as I know there are no simple solutions to this. I don't think getting the values from the controls will produce anything different. Search at www.outlook-code.com and see if you can find a discussion of this problem or example code. -- Hollis Paul Mukilteo, WA USA |
All times are GMT +1. The time now is 10:28 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-2006 OutlookBanter.com