Update documents with a modified Template

User avatar
Poppadon56
NewLounger
Posts: 9
Joined: 09 Feb 2014, 18:10
Location: Orleans, Ontario, Canada

Update documents with a modified Template

Post by Poppadon56 »

I needed to change the numbering to continue numbering for a number of styles in a user template (user1.dotx) and this template is used in over 10,000 documents. How do I update the documents so that they will be saved with the updated styles? I thought I could just open the document and do a 'save as' to reapply the updated template settings but that doesn't seem to work. It seems I have to go to every paragraph and set continue numbering and then do a save, is this the only way?

Thanks,

Don

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

Re: Update documents with a modified Template

Post by HansV »

How did you change the styles - please provide detailed information.
Best wishes,
Hans

User avatar
Poppadon56
NewLounger
Posts: 9
Joined: 09 Feb 2014, 18:10
Location: Orleans, Ontario, Canada

Re: Update documents with a modified Template

Post by Poppadon56 »

In Word, I opened the template, then Changed Styles, selected the style, Modify, Format.

I've attached two files, the updated template and an example of the document that I want to have the renumbering updated based on the updated template.

If I create a new document based on the template that works fine, it's all the existing documents that I want to update.
APPACCRUALDETAILS1.docx
CDFSProcessLayer.dotx
You do not have the required permissions to view the files attached to this post.

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

Re: Update documents with a modified Template

Post by HansV »

The styles CDFS Para 1, CDFS Para 2 and CDFS Para 3 are linked to level 1, 2 and 3 of a multi-level list, but CDFS Process Head 1, although based on CDFS Para 1, is not part of the multi-level list.
I don't think there is an easy way to do what you want. I tried to write code for it but I can't get it to work. (Code created by the macro recorder won't work correctly when played back.) Sorry!
Best wishes,
Hans

User avatar
Poppadon56
NewLounger
Posts: 9
Joined: 09 Feb 2014, 18:10
Location: Orleans, Ontario, Canada

Re: Update documents with a modified Template

Post by Poppadon56 »

I have removed the CDFS Para styles and only have CDFS Process Head n styles in the attached template. Does this make it any easier to be able to update the document?

Thanks again,

Don
CDFSProcessLayer.dotx
You do not have the required permissions to view the files attached to this post.

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

Re: Update documents with a modified Template

Post by HansV »

I'm afraid not. I tried the code I wrote yesterday, but it still doesn't update the document(s) correctly... :sad:
Best wishes,
Hans

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Update documents with a modified Template

Post by macropod »

If you attach the new template (or simply give it the same name as the old one and save it over the old template) and check the 'Automatically update document Styles' option in each document (which you could even achieve via a Document_Open macro in the template itself), that will automatically update the Styles in the documents next time they're opened.
Paul Edstein
[Fmr MS MVP - Word]

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

Re: Update documents with a modified Template

Post by HansV »

Hi Paul,

"Automatically update document styles" has been ticked in the sample document that Don attached. Opening the document will not make the numbering of the second CDFS Process Head 1 paragraph continue from the first.
Best wishes,
Hans

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Update documents with a modified Template

Post by macropod »

I suspect there's more going on in the APPACCRUALDETAILS1 document than is immediately apparent. For example if the first CDFS Process Head 1 paragraph Style (containing 'SCREEN LAYOUTS') is changed to the CDFS Para 1 Style, the paragraph number changes to 2! That's because someone has modified the numbering. Changing the Style definitions won't fix that. Similarly, the paragraph numbering for the second CDFS Process Head 1 paragraph Style (containing 'SCREEN ATTRIBUTES') is set to re-start at 1; again changing the Style definitions won't fix that. I'm not sure why, but I don't seem to be able to reset the numbering there to 'continue from previous list' other than by deleting everything from the 'SCREEN LAYOUTS' paragraph break to the start of 'SCREEN ATTRIBUTES', then inserting a new paragraph break and re-inserting the deleted content, plus killing off the numbering for the re-inserted content.
Paul Edstein
[Fmr MS MVP - Word]

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

Re: Update documents with a modified Template

Post by HansV »

Yikes! That doesn't lend itself easily to processing 10,000 documents...

Thanks for testing!
Best wishes,
Hans

User avatar
Poppadon56
NewLounger
Posts: 9
Joined: 09 Feb 2014, 18:10
Location: Orleans, Ontario, Canada

Re: Update documents with a modified Template

Post by Poppadon56 »

The documents were originally in Lotus Word Pro and were converted using a WordPro script 'Xpertss Batch Converter for Word Pro" by Doug Mackie to MS Word (*.doc). This converter worked good except there were a few problems and most have been fixed.

1) Head text on first line was not centered - Fixed.

2) Hyperlinks were not properly converted and required renaming from "*.lwp/" to "*.doc". - Fixed.

3) Text that was underlined had spaces that were underlined. - Fixed (thanks, Hans)

4) Numbering not converted properly. - Not fixed.

Is it possible to modify the XML code for the numbering, maybe change the CDFS Para styles to CDFS Process Head or similar?

Thanks,

Don

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

Re: Update documents with a modified Template

Post by HansV »

I did try to replaces styles, but although this works when applied manually, as also noted by macropod, it didn't change the numbering when applied through code.
Hopefully someone else can help...
Best wishes,
Hans

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Update documents with a modified Template

Post by macropod »

It appears that, aside from the starting # anomaly, the 'CDFS Para 1' Style does update correctly and the formatting of that Style looks to be the same as the 'CDFS Process Head 1 Style'. So, unless the 'CDFS Para 1' Style is used elsewhere in the document, the fix might be as simply as using Find/Replace to replace all instances of 'CDFS Process Head 1 Style' with the 'CDFS Para 1 Style', then resetting the 'CDFS Para 1' Style starting # to 1 for the first such paragraph. The alternative would be to use Find/Replace to go through all instances of the 'CDFS Process Head 1 Style' and reset their starting numbers sequentially.
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Poppadon56
NewLounger
Posts: 9
Joined: 09 Feb 2014, 18:10
Location: Orleans, Ontario, Canada

Re: Update documents with a modified Template

Post by Poppadon56 »

I went back to the original Lotus WordPro document and found that there was no SmartMaster (template) attached to the document. I surmised that when doing the batch conversion it didn't have a SmartMaster to use so it just converted as best as it could to MS Word.

I added a Lotus SmartMaster to the WordPro document and when converted the numbering worked for this simple document.

I will now go back to the WordPro documents and assign a SmartMaster to them and see what I get when converted to MS Word.

Thanks for all your help, I'm sure I'll be back.

Don

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Update documents with a modified Template

Post by macropod »

Since you still have Lotus WordPro, you may be interested in this article: http://word.mvps.org/FAQs/General/WordProConverter.htm" onclick="window.open(this.href);return false;
Paul Edstein
[Fmr MS MVP - Word]

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update documents with a modified Template

Post by ChrisGreaves »

Poppadon56 wrote:I needed to change the numbering to continue numbering for a number of styles in a user template ...
List Numbering is broken.
I thought I was clever enough to deal with it.
I wasn't.
http://www.chrisgreaves.com/ListNum/
See especially my link to John McGhie's page in my 3rd item.
There's nothing heavier than an empty water bottle

User avatar
Poppadon56
NewLounger
Posts: 9
Joined: 09 Feb 2014, 18:10
Location: Orleans, Ontario, Canada

Re: Update documents with a modified Template

Post by Poppadon56 »

To Macropod - I had been trying in WordPro the 'Save As' action to MS Word 97 (*.doc). The link you posted suggests to try to MS Word 6 for best results. I tried this with the same results as MS Word 97. It's frustrating because when I open the converted *.doc in WordPro, the numbering is OK. But opening the same *.doc in MS Word the numbering always starts at 1. I have tried to create and assign many different versions of templates to the *.doc but Word refuses to continue the numbering based on the template.

To Chris - I have read your article(s) on List Numbering and I agree that it is broken and at the very least not user intuitive. I will try to create a blank template with styles header, footer, default text, user header 1 and user header 2 and no other styles.

What will probably happen is that I will convert the documents with the numbering incorrect and then when a document requires a change the analyst will update the numbering in the document.

If anyone has any suggestions or needs more info let me know.

Thanks

Don

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update documents with a modified Template

Post by ChrisGreaves »

Poppadon56 wrote:...I will try to create a blank template with styles header, footer, default text, user header 1 and user header 2 and no other styles.
Hi Don. I started that series convinced that I could find a solution ("Nothing stops ME!") but soon realised that I should have started sooner, invented Microsoft, and kept a firm handle on design principles (grin).

Given that you still have the '000s of original documents (in whatever form), you MAY find it easier to use a machine with a fresh install of Word v?? whose galleries of list numbering templates (blah blah blah) is virgin and intact.
If nothing else, your converted documents would then be mapped to an original default set of styles and you could progress from there.

After a year or two I abandoned list numbering altogether and went to {SEQ} fields.

I remember writing some nifty macros for a client to restart numbering, continue numbering etc.
I'll see if I can dig up a description.
There's nothing heavier than an empty water bottle

User avatar
Poppadon56
NewLounger
Posts: 9
Joined: 09 Feb 2014, 18:10
Location: Orleans, Ontario, Canada

Re: Update documents with a modified Template

Post by Poppadon56 »

Chris, I will try what you suggested about a fresh install. I have a clean Windows XP laptop that I will reinstall MS Word 2003 and install Lotus Word Pro. I'll copy a few examples of my documents and give it a try.

Currently, if I open one of the converted documents and go line by line and renumber the document using Word this seems to work, but that process would be too long to do all the '000s of converted documents I have to do.

If you happen to find those macros to restart numbering I would appreciate it.

Thanks,

Don

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Update documents with a modified Template

Post by ChrisGreaves »

Poppadon56 wrote:If you happen to find those macros to restart numbering I would appreciate it.
I\ll go look.
I also have some document cleansing macros i wrote 15+ years ago to convert documents in bulk. Amongst other things they recognised many different sorts of numbering mechanisms and coerced them to a single format.
Once the numbering type is recognised it is dead-easy to convert that standard format to any required technique, e.g. Styles, {SEQ} fields, etc.
I'm on Hols, so I'll have to sneak this in when Miss Daisy isn't watching, or else I'll have to pretend I'm using Google maps to locate Shopping malls ... :rofl:
There's nothing heavier than an empty water bottle