I need a corrupted Normal

D

dragos98

I'm trying to determine if it's possible to recover customized styles
from a corrupted Normal (Office X).

The problem is I don't have a corrupted Normal. Do you have a
corrupted file?

Thanks.
 
D

Dayo Mitchell

If you can open the Normal, you should be able to copy over the customized
styles via the Organizer (under Tools | Macros).

DM
 
D

dragos98

I think it works too.. But I need to try it to be sure. So I need the
corruppt file
 
H

Howard Kaikow

A template can become corrupted in many ways, so you would need at least
umpteen different corrupted templates for testing

It would appear that the only issue of concern is whether you can recover
a style.
The first requirement is to be able to access the template, e.g., by opening
the template directly or by attaching the template to a document.

The next step is to try to access the style. This could have a number of
outcomes:

1. For whatever reason, you cannot access the style.
This might occur if the style does not exist or its definition is
sufficiently crippled to permit accessing the style.

2. You might be able to obtain some, but not all, correct values of the
style's attributes.

3. Some of the style's attributes may not be available.

4. You might be able to obtain all of the style's attributes.

Using a macro, you could test for the above conditions.
Of course, a macro has no way of knowing when a style is returning an
incorrect value for an attribute, other than by comparing with desired
values coded in the macro.

It is not necessary to have a corrupt template to write code that will
properly test the above conditions.
 
D

dragos98

I'm trying to determine if it's possible to recover customized styles
from a corrupted Normal, using the Organizer. Unfortunately, I have no
idea on how to program a macro to simulate this.
 
H

Howard Kaikow

The best you can do is write a macro to recover a style from a non-corrupt
document.
After that is working, then add error handling code to gracefully continue
when you are unable to recover a style or particular properties of a style.

Think of the task as being analogous to a macro that performs actions based
on user inputs, say, in a TextBox.
Your code has to be able process "good" input, but also needs to be able to
handle "bad" input, the latte would be analogous to not being able to
recover a style or particular style properties.
 
J

John McGhie [MVP - Word]

Yes, it *is* possible to do that, provided that the corruption in Normal has
not affected the styles in question.

Usually, the corruption in a template affects the bullets and numbering list
templates. If that is the case, Word will crash as soon as you attempt to
access the damaged list template.

You can easily copy styles from a template using the OrganiserCopy method.
However, if those styles have list templates attached, the list templates
will NOT be copied.

You can create a macro to copy the list template associated with a style,
copy the style using the organiser, then add the list template to the
document, then attach the added list template to the style you just copied.

We normally assign a name to the list template while it is in transit to
make it easier to find it when you add it to the new template.

Often, it is preferable to simply retrieve the properties you are interested
in from a list template, then re-create the list template in the new
template.

When working in VBA, you have to open the template as a document in order to
get OrganiserCopy to work.

What I am saying here is "Yes," this is possible. However, you need to be
very good at VBA to do this economically. I am happy to help you, but be
prepared for some long nights slaving over a hot compiler :)

Cheers

from said:
I'm trying to determine if it's possible to recover customized styles
from a corrupted Normal, using the Organizer. Unfortunately, I have no
idea on how to program a macro to simulate this.

--

Please respond only to the newsgroup to preserve the thread.

John McGhie, Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:[email protected]
 

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

Top