styles replaced with some other style

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

styles replaced with some other style

Post by Robie »

Word 2003 (but could be 2007/2010).

I have had to recently update our company template to completely change the front cover and remove the back cover. Change default font to Arial from Verdana. That is basically it.

Now, we need to update the current documents (using the old style front cover, back cover and Verdana font). So what I do (as part of a VBA conversion routine) is *just* copy the contents of the old style document into the a brand new document (created using the latest template). Copy & paste is fine - everthing looks good, incuding the change of font from Verdana to Arial.

All this is fine except when I *save* the updated document. It replaces some of the content with different styles. For example, 'Table Grid' becomes 'TOC 2' even though Table Grid as a style is already present in the document. This is not consistent either - it depends on the number of exta styles in the document being converted. Other styles could also be replaced with different styles.

The differences are that the template has a set number of styles. The document for 'conversion' has *more* styles (presuming these have been added by the user) than available in the template'. Could it be something to do with these extra styles?

I am at a total loss here. Any help (urgent) highly appreciated. It's a nightmare. Thanks.

For example - Table Grid style replaced with Toc 2:
conversion.png
You do not have the required permissions to view the files attached to this post.

User avatar
StuartR
Administrator
Posts: 12610
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: styles replaced with some other style

Post by StuartR »

I don't know if it will fix your problem, but you could try updating the old documents by attaching the new template, and setting the checkbox to "Automatically update document styles". This should override the styles in your document with those in the template.
Templates and Add-ins.png
You do not have the required permissions to view the files attached to this post.
StuartR


User avatar
HansV
Administrator
Posts: 78500
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: styles replaced with some other style

Post by HansV »

But Robie mentioned that the front cover page had changed and that the back cover page was to be removed. Changing the attached template will not do that.
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: styles replaced with some other style

Post by Robie »

Thanks Stuart & Hans.

Stuart: I do the equivalent of your suggestion within my vba code, i.e.

Code: Select all

With ActiveDocument
        ' update styles to arial
        .UpdateStyles
        ....
        ....
End With
Hans: I can delete the contents of the front cover, copy over the front page of the template. Delete the back cover and reset the headings/footers. All this is achievable but the styles is screwing me up. That's why I thought if I copy over the contents of the old documen to new then I don't need to worry about the front cover and back cover (it's already set in the new template).

I even tried copying the styles from template to the document but that doesn't seem to work either. In fact, when I copy the styles the setting are different. That, I don't understand. It's difficult to put up a sample as all the company stuff is tied in together. But more information is as follows, if it helps:
original template styles.png
You do not have the required permissions to view the files attached to this post.

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: styles replaced with some other style

Post by Robie »

OK. Now thre is more.

I opened the old document. Of course the template name is same as the old one so all I did was what Stuart suggested, enabled the 'Automatically update document syles' checkbox. Clicked OK. Just to start of with the TOC 2 styles changed into 'Questions type style'. See example:
updatestyles.png
You do not have the required permissions to view the files attached to this post.

User avatar
StuartR
Administrator
Posts: 12610
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: styles replaced with some other style

Post by StuartR »

Are you sure there is nothing strange about the TOC2 style in your new template?

Do you have a question style that looks like the one you show in your image? Can you compare this to your TOC2 style and let us know what is the same and what is different.
StuartR