I'm familiar with modifying/intercepting built-in
commands, using macros named with the command's name
(i.e., FileSave, FormatStyle, etc.).
And I understand that you can go to the Macros dialog,
select from the list of built-in commands, and create a
macro from there.
Here's my question:
If I go to the list of Word Commands, and Select "Style",
then tell Word to create that in my current template, I
get this:
Sub Style()
'Styles macro
'Applies an existing style or records a style by example
WordBasic.Style
End Sub
Under what circumstances would this macro be called (I
recognize that WordBasic.Style is invalid without a
style)?
I'd like to intercept the application of a specific style,
and can't find any information on modifying built-in
commands that require parameters (like Style or Font).
Any help would be appreciated.
Thanks,
Andrew Savikas
Klaus Linke - 03 Oct 2003 08:39 GMT
Hi Andrew,
The command you are looking for is "RedefineStyle", not "Style".
(BTW, I don't think you can intercept (WordBasic) commands that take
arguments.)
Regards,
Klaus
> I'm familiar with modifying/intercepting built-in
> commands, using macros named with the command's name
[quoted text clipped - 28 lines]
> Thanks,
> Andrew Savikas
Word Heretic - 03 Oct 2003 15:36 GMT
G'day "Andrew Savikas" <andrews@NOSPAM.oreilly.com>,
not only is Klaus spot on the $$$, but do tell us, what are you trying
to achieve and maybe we can help with that :-)
"Andrew Savikas" <andrews@NOSPAM.oreilly.com> was spinning this yarn:
>I'm familiar with modifying/intercepting built-in
>commands, using macros named with the command's name
[quoted text clipped - 28 lines]
>Thanks,
>Andrew Savikas
Steve Hudson
Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email steve@wordheretic.com
Products http://www.geocities.com/word_heretic/products.html
Replies offlist may require payment.
Andrew Savikas - 03 Oct 2003 17:59 GMT
There are really quite a few things I would do if I knew
how to intercept the application of a particular style
(the language about redefining an existing one came from
Word, not from me)
For instance, I'd love to be able to prevent users from
applying a paragraph style to only a portion of a
paragraph (we all know what kind of fun that leads to),
something like this (I know it's oversimplified):
Sub Style(Applied_Style)
Selection.Paragraphs(1).Range.Style = Applied_Style
End Sub
Or, it would be great if I could use SEQ fields to apply
numbering to styles automatically (by intercepting their
application).
Thanks!
Andrew Savikas
>-----Original Message-----
>G'day "Andrew Savikas" <andrews@NOSPAM.oreilly.com>,
[quoted text clipped - 46 lines]
>Replies offlist may require payment.
>.
Word Heretic - 04 Oct 2003 03:16 GMT
G'day "Andrew Savikas" <andrews@NOSPAM.oreilly.com>,
ahhhh. I have some bad news for you I am afraid. It is possible to
monitor every damn keystroke - AT THE TOTAL EXPENSE OF USABILITY. It
turns a P4 into a 486. So I wont even bother trying to discuss that
option - its essentially pointless. For the small gains you make, you
lose a heap. wdls can be a heap faster if you are prepared to lose all
social skills and become a full-on softie.
However, we always have more that one way to skin a cat.
www.mvps.org/word/FAQs/index.html has a heap of VBA. So does my Word
VBA Spellbook. If you need help coming up to speed start there.
Amongst the gems online you will find a batch processing routine. I
can't remember which way they do it, there's a few different ways
basically.
The concept is you post-process documents back to your standards. Do
this in a global template and you can then instantly fix any loaded
document anytime. Also include a batched version and you can do entire
folders and their sub folders with the click of a button.
FWIW, I just finished writing a future time line for the field of
technical writing. It shows an increase in these sorts of tools over
the next 8 years, culminating in expert systems that leave many
editors out of work. If you want to ride that wave, start paddling now
:-)
"Andrew Savikas" <andrews@NOSPAM.oreilly.com> was spinning this yarn:
>There are really quite a few things I would do if I knew
>how to intercept the application of a particular style
[quoted text clipped - 72 lines]
>>Replies offlist may require payment.
>>.
Steve Hudson
Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email steve@wordheretic.com
Products http://www.geocities.com/word_heretic/products.html
Replies offlist may require payment.
Cindy Meister -WordMVP- - 05 Oct 2003 10:15 GMT
Hi Andrew,
> I'd love to be able to prevent users from
> applying a paragraph style to only a portion of a
> paragraph (we all know what kind of fun that leads to),
This is now supported in Word 2003...
Cindy Meister

Signature
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)