none
"oooo"-ing and "aaaa"-ing with Format() RRS feed

  • Question

  • Word 2010 SP1 x86 on Win 7 SP1 x64

    According to VBA Help, Format (Date, "dddd") should return the same thing as Format(Date, "aaaa"), except with the latter being localized. Likewise, for "mmmm" and "oooo".

    When I try this with Windows date settings set to English (United States), I get these results:

    Format(Date, "dddd"): Tuesday

    Format(Date, "aaaa"): aaaa

    Format(Date, "mmmm"): August

    Format(Date, "oooo"): oooo

    So I switched my Windows Date localization to French (France) and tried again:

    Format(Date, "dddd"): mardi

    Format(Date, "aaaa"): aaaa

    Format(Date, "mmmm"): août

    Format(Date, "oooo"): oooo

    So "dddd" and "mmmm" appear to be localized already, while "aaaa" and "oooo" are treated as literals.

    1. Do the "aaaa" and "oooo" format strings actually do anything?

    2. If they do, but only in languages other than English & French, are there "aaa" and "ooo" variants the documentation forgot to mention?

    Or is oooo and aaaa as broken as & and @?

    Tuesday, August 23, 2011 5:18 PM

Answers

  • How peculiar. WIth my location set to UK, and my office UI set to French (just what I had set up - no special reason), I switched number formats to various locations and only when I used a Far Eastern language did I get anything other than what you describe. With Japanese, "dddd" gave me English names and "aaaa" gave me Japanese.
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by JRV529088 Tuesday, August 23, 2011 7:57 PM
    Tuesday, August 23, 2011 7:42 PM

All replies

  • How peculiar. WIth my location set to UK, and my office UI set to French (just what I had set up - no special reason), I switched number formats to various locations and only when I used a Far Eastern language did I get anything other than what you describe. With Japanese, "dddd" gave me English names and "aaaa" gave me Japanese.
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by JRV529088 Tuesday, August 23, 2011 7:57 PM
    Tuesday, August 23, 2011 7:42 PM
  • Interesting...I just didn't try the right languages.

    It does seem that "oooo" and "aaaa" should return the same as "mmmm" and "dddd" except where they're used for something different.

    And it also needs better documentation...but then, that removes half the challenge of using VBA, doesn't it!

    Thanks, Tony!

    Tuesday, August 23, 2011 7:56 PM
  • that removes half the challenge of using VBA

    LOL! That's one way of looking at it!
     

    Enjoy,
    Tony
    www.WordArticles.com
    Tuesday, August 23, 2011 8:29 PM
  • Hi Jeff/Tony

    If (either of) you could locate the Language Reference item on MSDN and add a Comment at the bottom and/or click the "Did this help you" in the VBA Editor Help, then write up a short correction, the Help might eventually get updated to reflect the correct information...


    Cindy Meister, VSTO/Word MVP
    Wednesday, August 24, 2011 6:43 AM
    Moderator
  • You know, Cindy, that never crossed my mind!
     
    I have occasionally noticed comments on MSDN but they are usually short and often cryptic and I have never got the impression they were worth adding. Correcting Help could easily be a full time occupation, of course <g>
     
    The French Help in Office 2010 does not mention this at all. Neither does the Japanese Help, which, as it actually has an effect in Japanese, one might expect. It was a struggle to find the content on MSDN - and it doesn't exist in either French or Japanese there - but, having found it, I have now posted a comment.
     

    Enjoy,
    Tony
    www.WordArticles.com
    Wednesday, August 24, 2011 11:41 AM
  • Hi tony

    <<The French Help in Office 2010 does not mention this at all. Neither does the Japanese Help, which, as it actually has an effect in Japanese, one might expect.>>

    Youd' think so, wouldn't you...

    When working on a book I run into all kinds of bloopers as well as out-right errors in the VBA Help. Like the codes samples for Custom XML Parts (my hobbyhorse of last week). It makes me so angry to see such blatant errors that I take great satisfaction in clicking the "No" button for the question "did this help" and writing out, in detail, what the problem is.

    Especially at this point in the product cycle, when the people who write the help aren't under pressure for documentation for a new version, I figure this must give them something to do...

    As far as the MSDN stuff goes, I have actually see Help text get corrected (although what I know I've seen may not have been Word).


    Cindy Meister, VSTO/Word MVP
    Wednesday, August 24, 2011 12:45 PM
    Moderator
  • The ones that tend to annoy me the most are the error messages that say "Unexpected error, Did this help?", followed by a total lack of feedback when you click on No.
     
    My comments on MSDN have not appeared. The FAQ says they should appear immediately but, after trying three times, they haven't, so I have just sent feedback - if that falls down the same crack as the comment, they'll never know I tried.
     

    Enjoy,
    Tony
    www.WordArticles.com
    Wednesday, August 24, 2011 1:25 PM
  • Hi tony

    If nothing happens, post the link and the text you used and I'll give it a try...

    Most times, my comments do show up, but I don't check every single time I do it.


    Cindy Meister, VSTO/Word MVP
    Wednesday, August 24, 2011 1:55 PM
    Moderator
  • Thanks, Cindy.
     
    I just tried again, and I signed out and back in and tried one more time. Still nothing.
     
     
    Title: "aaaa" and "oooo" formats are a bit of a mystery.
     
    Text as below.
     

    According to this article (and Word Help in English, though not in other languages I checked), "aaaa is the same as dddd only it's the localized version of the string".

    Although other systems produce the same result, using a fully up to date Windows 7 and 64-bit Office 2010 SP1 system ....

    With (UK) English settings, Format(Date, "dddd") returns "Tuesday", for example, and Format(Date, "aaaa") returns "aaaa". In other words, "aaaa" is not being recognised as anything other than a literal.

    With WIndows and Office UIs both set to Japanese but with Regional Formats still set to <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:place w:st="on"><st1:country-region w:st="on">UK</st1:country-region></st1:place>, I get exactly the same result.

    With Regional Formats set to France, apparently regardless of Windows or Office UI, Format(Date, "dddd") returns "mardi", whilst Format(Date, "aaaa") continues to return "aaaa"

    With Regional Formats set to Japan, again apparently regardless of Windows or Office UI, Format(Date, "dddd") returns "Tuesday", but this time Format(Date, "aaaa") returns 
    火曜日.

    Further tests with a variety of language combinations seem to confirm that the only factor that affects the behaviour of these patterns is the Regional Format and that only when a Far Eastern locale is chosen does "aaaa" have any effect. In all other cases the localised day name is returned using the "dddd" pattern.

    The "oooo" pattern performs in a similar way. It's hard to tell what exactly these patterns should do, or do do.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>


    Enjoy,
    Tony
    www.WordArticles.com
    Wednesday, August 24, 2011 3:27 PM
  • Hi Tony

    Thanks for hanging in with this :-)

    It appears for me - check the link and see if you can see the comment?


    Cindy Meister, VSTO/Word MVP
    Wednesday, August 24, 2011 3:29 PM
    Moderator
  • What? You can see it now?
     
    I just tried in a different browser (Safari, that I only use occasionally for testing, so there should be no caching issues) and I don't see it.
     
    Got it! I normally use "Lightweight View" - described as "a balance between fast and rich". I switched to "Classic View" and now I see what you posted.
     
    It seems that "lightweight" means "doesn't work" :-( Why do they let me go through the whole process without any indication of failure, only to ignore what I do? It really doesn't encourage one to make an effort.
     

    Enjoy,
    Tony
    www.WordArticles.com
    Wednesday, August 24, 2011 4:21 PM
  • Actually it's worse than just not working on submissions. It would seem that I just don't see community content at all in Lightweight View, but I do see the heading and, as the "Add" button goes through all the motions, I had assumed I would see it if there were any. The Script-free View doesn't have the heading so I guess you just never know of the concept if you use that.
     
    Anyway, thank you for posting. I'll go back to using Classic View for now.
     
     

    Enjoy,
    Tony
    www.WordArticles.com
    Wednesday, August 24, 2011 5:19 PM
  • Hi tony

    Ah. IE keeps trying to put me in lightweight view, but so often I'm searching in the "tree" that I want to see the "TOC" on the left AND the breadcrumbs at the top I just automatically switch to Classic. It's slower, but usually more convenient for the work I do.

    You might give some feedback, via your lead and perhaps also in the private forum about this "oversight" in the lightweight UI.


    Cindy Meister, VSTO/Word MVP
    Wednesday, August 24, 2011 5:31 PM
    Moderator
  • This sure got to be a busy thread while I was frivolously attending to life outside the VBE! Thanks, Tony & Cindy, for helping MS make VBA & MSDN better places to live.

    Thursday, August 25, 2011 1:16 AM
  • <g>Your community at work!
    Cindy Meister, VSTO/Word MVP
    Thursday, August 25, 2011 8:47 AM
    Moderator