I had a vague recollection that that should work (in fact I think it's
because I pushed for it), but I didn't see 'name' property of Word style in
the dictionary, so I didn't try. My loss. Evidently as an element of
'document', Word style 'by name' has been mapped to the name local property,
which is great. Yes, I'm pretty sure I asked for that. It had to be called
'name local' to correspond to the VBA, but it was mapped to element Word
style 'by name'. Thanks for the correction, Matt.
A bit more:, as it's coming back to me:
I had actually hoped that we could get a whole set of enumerations - as
exists for 'base style' property, for example - for the built-in style, such
that you could get
Word style normal style of active document
no matter what the user's localized name for "Normal" is. If I remember
correctly, this was not possible because the object model puts user-created
styles, which might be called anything, on the same footing as built-in
styles. They're all in the same collection of styles, just as you see them
in your Styles list in the Format in the UI. (It might be nice to have a
special set of 'built-in styles' but that would have to be done in the
object model itself, and for VBA. They may be looking into something like
that. There is a 'built in' boolean property for checking which styles are
built in and which aren't.) ) As a sort of compromise, that mapping of
element 'by name' to 'name local' was done so it's possible to get
Word style "Normal"
if it exists by that name. I'd forgotten that (obviously). That works if
you're making a script just for yourself, or with error traps and warnings
to non-English users. (The same applies to JE's VBA macro, and for the same
reasons. Style ("Normal") won't exist for non-English-speaking users.)
Many of the most important built-in styles, such as Normal, are indeed base
styles, but I can't find any way to "cheat" and identify an actual Word
style of a document with one of these enumerated base styles. I.e.
every Word style of active document whose base style is style normal
--> {list of 158 styles}
works, but something like
every Word style of active document where it is equal to style normal
--> {}
doesn't get anything since a Word style can never equal a base style
property of a Word style.
I still think it would be good to have enumerated built-in styles. I can't
see any way to do this at present.
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.