Re: Fighting with templates (again) -- using John McGhie's "LabelStyles" and "RestoreStyles" macros
From: Hank Roberts (hank_at_spamcop.net)
Date: 03/11/04
- Next message: ilse: "footnotes suddenly not available for cross-referencing!"
- Previous message: rgc: "Booklets"
- In reply to: Margaret Aldis: "Re: Fighting with templates (again)"
- Next in thread: Margaret Aldis: "Re: Fighting with templates (again)"
- Messages sorted by: [ date ] [ thread ]
Date: 11 Mar 2004 11:08:03 -0800
"Margaret Aldis" <Margaret.Aldis@mvps.(SpamStopper)org.invalid> wrote in message news:<O0LQrEGAEHA.3220@TK2MSFTNGP10.phx.gbl>...
...
> need to paste text into a fresh document shell - via some 'cleaned out' form
> (some people simply strip all the formatting out completely, but you can
> often find semi-automatic ways of making use of what tagging and formatting
> is already there provided you go via a 'quarantine' document).
Hi Margaret,
I'm back (formerly known as 'hank@netcom.com') and again wrestling
Word (2000 SR-2 here now).
I've seen references to saving through HTML and back fixing the
accumulated corruption, but haven't gotten it to work for the files my
employer puts in front of me (we have been accumulating cut-and-pasted
formatting since the switch from VMS Mass-11 to Word 3.1, so there's a
bit of corruption in the background environment, ahem.)
You mention ways of making use of tags; in catching up I've posted
this in some other followups but this seems the best thread -- my
successes so far have come from using John McGhie's old "LabelStyles"
and "RestoreStyles" macros, the first one reading the Style name and
pasting it in angle brackets at the front of each paragraph; the
latter reading the ASCII file and applying Styles according to what it
finds in angle brackets.
When used a few years ago -- to leave corruption behind, before the
Char Char Char feature -- the intervening step was simply saving to
ASCII, closing, reopening, and running RestoreStyles.
Now with the Char Char corrupted styles, on our setup we simply can't
get rid of them -- Heading 4,Heading 4 Char, Char, Char blocks any
attempt to rename it, or to overwrite it with the stock Heading 4, for
example.
I remembered the Label and Restore tricks and thought to take the<
ASCII file, remove the <corrupt Style name> strings and replace them
with <good Style name> strings, while the file is in ASCII -- then let
ReplaceStyles put in the proper Styles when the doc is changed back to
Word. It does work.
Now, I find when I save to ASCII, then search out all the strings with
garbled Style names and replace them with the stock NORMAL Style names
-- this does work. It requires creating a plain vanilla document, and
manually putting in under the stock Style names the formatting the
user wanted to see that had gotten put into the Char Char Char
definitions.
That means taking the corrupt original and doing Print/Print Styles,
and hand copying those definitions into the new vanilla doc, under
standard names for Styles (based on No Style, not based on Normal, for
safety later on).
Then, John's RestoreStyles macro looks in the angle brackets, finds
where I substituted "<Heading 1>" in place of "<Heading 1
Char,Heading1 Char Char>"
and applies the Heading 1 style.
It does recreate the desired formatting -- assuming I've hand-defined
under Heading 1 the formatting the author had in under the corrupt
name -- paragraph by paragraph, and will rip through a 270 page Word
document in a couple of minutes, and it will look like it's supposed
to while having only good Styles.
(When the macro hangs, 'Debug' shows the problem (always means I
forgot to search/replace out one of the corrupt style names from the
ASCII file), which I can usually do on the fly and resume the macro
running).
I haven't seen John's macros published at the MVPS site; is something
like this already set up for people to use? Someone (not I) competent
with macros might be able to find a way to pull out more of this that
I'm doing by hand.
---> I've tossed this in just before going offline for a period of at
least three days, maybe a couple of weeks, in haste; hope it makes
enough sense to follow, and I'll check back as soon as I can. -- Hank
Roberts
- Next message: ilse: "footnotes suddenly not available for cross-referencing!"
- Previous message: rgc: "Booklets"
- In reply to: Margaret Aldis: "Re: Fighting with templates (again)"
- Next in thread: Margaret Aldis: "Re: Fighting with templates (again)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|