UserProperties Date/Time format

B

Bill

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
 
S

Sue Mosher [MVP-Outlook]

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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
B

Bill

Hollis Paul said:
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.
 
H

Hollis Paul [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top