• new template cleanup?!?

    Author
    Topic
    #1767910

    I created a new template for my department. (W97) I have distributed it to the users and now…well, they’re running amuck. *sigh*

    One particular problem they’ve run into while converting an old document to a new document using the new template is that when the user opens the document, once saved, the numbered lists ignore “restart numbering” where it was placed when last saved, and it runs on and on. The other problem is that the bullets seem to get an added tab somewhere. SO now the text appears too far away from the bullet.

    What is making this happen and how can I fix this? I should note that when converting documents, I have told everyone explicitly that the only way we’ll get clean documents is by going line by line and not including the paragraph mark. I know this is a PIA but it’s the only way I can know that will not bring in formatting from the other document. (most of the time created in normal style and using spaces to line up text )

    The only thing I can think of is when the user copies the text from one document to the new document using the new template, they are copying a paragraph tag and not telling me. Now that they know not to do it they are adamant about saying they didn’t do it. They also know that there is NO adding other styles to the template. That’s why we needed a new template in the first place.

    I believe the bullet thing is caused by a stray tab fitting into the style somewhere… but I don’t know what’s causing the numbering to malfunction.

    thanks for anything you can offer… it’s Monday….please be gentle…
    have fun

    Viewing 1 reply thread
    Author
    Replies
    • #1776610

      Hi KT,

      Yow – this sounds like a nightmare.

      A few thoughts:
      Simple, non-outlined numbers are going to lose their restarts when you reapply a numbering style to them – that’s because the restarts are a direct formatting feature and they get wiped out when you reapply the numbering style.

      With the bullets, if the extra tab is not an extra physical tab mark, but rather the tab setting in the style has gone funny, this could be fixed in one shot by going to the relevant style and fixing it there. That fix should then flow to all paragraphs in the document, that have that style.

      The biggest impression I get though is: there’s got to be an easier way! – you must have vey patient users, to put up with copying an entire document line by line!.

      The best way to do this conversion would be to automate it with a macro, but there are still some big timesavers available, even without using a macro:

      Apply Normal style to the entire document.
      Control+Q and Control+spacebar to remove all direct paragraph and character formatting.
      Do a Find/Replace, replacing all double paragraph marks (^p^p) with a single paragraph mark (^p).
      You might also want to have them go into Normal view, and delete all the section breaks, depending on the document layout and what you want to bring across to the new documents.

      Then just tell the users to select the entire document, minus the last paragraph mark (Control+A and then Shift+LeftArrow), copy, and then paste into the new document.

      They will then have to reapply all the required styles, but it sure beats cutting and pasting an entire document line by line!

      Hope this helps,
      Gary

      • #1776640

        Gary, my friend, you have no idea…*cry*

        I am using outline numbering… only the first level though. So does that negate your “direct formatting” comment?

        I think I got the bullets cleared up…

        The problem with creating a macro is time… I’m no Andrew Lockton or Gary Frieder when it comes to those… I’m lucky I was able to create a toolbar so any author can insert messages easily…*sigh*…and brainlessly

        I guess I’m a bad mommy but I had two options when I had to go about telling everyone how to convert the documents to the new template…your way, by stripping everything then re-applying new, or my way, paragraph by paragraph. The problem here is that I wanted to really make the users understand what the paragraph marks are for, why it’s so important to use style and why it’s bad form to make up your own 2,003 styles on a whim. I may give them a choice in our next meeting though… I’m still developing the document conversion guide.

        Mind you, I’m a Jr. Tech Writer by years of experience only. When put in a room with the other “Senior” Writers (Charlotte can scream at me for the pun) I can run circles around them with any given document in Word. Hence I was chosen to create the template for the department. Go figure. This also stretches my talents to teaching everyone the ins and outs of Word. Not an easy task when deadlines are rolling around the corner…

        I’ll stop whining now Thanks for all your help though! It’s always appreciated more than you know!!
        have fun

        • #1776651

          Here’s a quick-and-dirty macro for Word97 that will copy the contents of an existing document (you’re prompted for the full path and filename) to a new document based on the template of your choice (again, you’re prompted for the full path and filename), leaving behind the paragraph marks (and associated formatting) found in the original document.
          Maybe this will speed things up for you. Like I said, it’s QAD, and if it looks useful I’d be happy to help streamline it (although there must be lots of code gurus out there who can do it better and faster).

          Anyway, here’s the code. I hope it makes the trip through cyberspace without too much degradation:

          Sub CopyDocWithoutParagraphMarks()
          Dim docNew As Document, docOld As Document
          Dim strNameOfNewTemplate As String ‘ Prompt for template name, including complete path if needed
          Dim strNameOfOldDocument As String ‘ Prompt for “old” document name (the document being recreated)
          Dim strCopiedText As String ‘ temp variable to hold text being copied from docOld to docNew
          Dim intParaCount As Integer

          strNameOfOldDocument = InputBox(“Please enter the complete path and filename of the document you wish to recreate:”)
          strNameOfNewTemplate = InputBox(“Please enter the complete path and filename of the template on which you wish to base the recreated document:”)

          Set docNew = Documents.Add(Template:=strNameOfNewTemplate, newtemplate:=False)
          Set docOld = Documents.Open(strNameOfOldDocument)
          docOld.Activate
          For intParaCount = 1 To docOld.Paragraphs.Count
          With docOld
          .Activate
          .Paragraphs(intParaCount).Range.Select
          Selection.MoveEnd unit:=wdCharacter, Count:=-1
          strCopiedText = Selection.Text
          End With ‘ docOld
          With docNew
          .Activate
          .Range.SetRange Start:=wdEndOfDocument, End:=wdEndOfDocument
          Selection.TypeText strCopiedText
          Selection.TypeParagraph
          End With ‘ docNew
          Next intParaCount

          End Sub

          • #1776652

            Michael,
            It looks great…and I have to try it when I get back to work though.

            I talked to a few of the gals at work…the users of the template, and I told them about the “strip everything then re-apply” method and noses scrunched up.

            The problem, as they see it, is that they would loose all the formatting then forget what is what…we’re talking about 100+ pages here…

            Another problem with this that I didn’t think about when posting my original message, is that the original manuals are mostly in tables, manually numbered and all sorts of other mean nasty things… a HUGE reason for the updated template.

            This will probably affect your code and answers…well, I don’t want to think about it anymore today…I’m home and should be vegging in front of the TV… Thanks for everything!!
            have fun

            • #1776654

              KT

              The simplest way to strip formatting when pasting is to choose Edit > Paste Special and choose text only. Everything will come in using the style where the cursor was when you chose the command.

              This strips graphics, breaks and formatting and converts tables to text and makes autonumbers hard coded. You may want to remove those before copying if you want to reinstate them automatically. That is done by Ctrl-A and then turning off autonumbering. The Paste Special is all powerful and leaves styles etc behind.

              You shouldn’t don’t need to go that hard though for huge documents. Just select everything and remove local and paragraph formatting so everything returns to the way the StyleGods intended. (Ctrl-Q, Ctrl-Space). Do some cleanups to delete unused styles (use a macro) and extra goodies such as double returns, paragraphs tabbed in etc.

            • #1776787

              This isn’t really a reply, except to say if I were KT I’d still be crying at the unformat everything options. It’s way difficult to take a now-unformatted document that was full of formatting like tables and bulleted or numbered lists and then try to figure out what the original formatting was. You have to go through page by page with a printout of the original document in front of you, and even then, I hope to never have to put a large table back together.

              I’d be trying to provide a conversion toolbar with some number of macros that would fix up the major problem areas, and let the users copy in the formatting. I’d want (as a user, I’m speaking) to be able to copy in at least whole chapters, then have a macro go through the document and stop at every style that isn’t in some approved style list and have the user change the style to an approved one. Maybe a macro could correct the numbering restart? Another one could reset the tabbing? I don’t even know if what I want is possible, but if any of you provide it, I’m certainly going to save it.

            • #1776809

              Sure Wendy

              It is possible and that type of clean-up has been implemented many times before. Unfortunately, each solution is specific to the company/person that want the styles. Different people put different things into a file and the clean-up can only do so much before the truly odd things become the problem. We would also need to know what is a style name to keep, what to replace with etc.

            • #1776904

              You guys are truly great… thanks for trying to fight for my sanity!

              But the reorganization the owners of the documentation want is formidable. So copying line for line is just about the easiest way to do this short of rewriting the document.
              I just want to make sure that no corruption or renegade styles are imported into the new documents. When someone is stuck updating these manuals a few years from now they won’t have to go through this crap again.

              Another factor is these manuals may be converted to HTML soon (soon enough that I may be recruited as the poor sap to do the conversion) and having everything in a strict style setup is essential for that conversion. This is getting to be a bigger nightmare each time I post isn’t it…
              have fun (I know I’m trying)
              KT

          • #1816664

            Hi,

            In given below code, as i run the macro , the highlighted line gives some error

            “Word was unable to read this document”
            Try one or more of the following:
            1) open and repair the file
            2) use text converter

            Please suggest, what am i doing wrong?

            Help awaited

            Here’s a quick-and-dirty macro for Word97 that will copy the contents of an existing document (you’re prompted for the full path and filename) to a new document based on the template of your choice (again, you’re prompted for the full path and filename), leaving behind the paragraph marks (and associated formatting) found in the original document.
            Maybe this will speed things up for you. Like I said, it’s QAD, and if it looks useful I’d be happy to help streamline it (although there must be lots of code gurus out there who can do it better and faster).

            Anyway, here’s the code. I hope it makes the trip through cyberspace without too much degradation:

            Sub CopyDocWithoutParagraphMarks()
            Dim docNew As Document, docOld As Document
            Dim strNameOfNewTemplate As String ‘ Prompt for template name, including complete path if needed
            Dim strNameOfOldDocument As String ‘ Prompt for “old” document name (the document being recreated)
            Dim strCopiedText As String ‘ temp variable to hold text being copied from docOld to docNew
            Dim intParaCount As Integer

            strNameOfOldDocument = InputBox(“Please enter the complete path and filename of the document you wish to recreate:”)
            strNameOfNewTemplate = InputBox(“Please enter the complete path and filename of the template on which you wish to base the recreated document:”)

            Set docNew = Documents.Add(Template:=strNameOfNewTemplate, newtemplate:=False)
            Set docOld = Documents.Open(strNameOfOldDocument)
            docOld.Activate
            For intParaCount = 1 To docOld.Paragraphs.Count
            With docOld
            .Activate
            .Paragraphs(intParaCount).Range.Select
            Selection.MoveEnd unit:=wdCharacter, Count:=-1
            strCopiedText = Selection.Text
            End With ‘ docOld
            With docNew
            .Activate
            .Range.SetRange Start:=wdEndOfDocument, End:=wdEndOfDocument
            Selection.TypeText strCopiedText
            Selection.TypeParagraph
            End With ‘ docNew
            Next intParaCount

            End Sub

            • #1816665

              It means that either you haven’t entered the correct path and filename for the template to be used, or else that the template has become corrupt. Can you open the template directly in Word?

            • #1816666

              Yes, I can open it directly in Word.

              after inserting the path where document lies, I also write the filename. Hope I am doing right.

              Hi,

              In given below code, as i run the macro , the highlighted line gives some error

              “Word was unable to read this document”
              Try one or more of the following:
              1) open and repair the file
              2) use text converter

              Please suggest, what am i doing wrong?

              Help awaited

            • #1816667

              The line

              strNameOfNewTemplate = InputBox(“Please enter the complete path and filename of the template on which you wish to base the recreated document:”)

              asks you to enter the path and filename of the template. The next line

              Set docNew = Documents.Add(Template:=strNameOfNewTemplate, newtemplate:=False)

              tries to create a new document based on the template. Since you can open the template directly, the problem doesn’t appear to be caused by the template. The most probable explanation for the failure is that you haven’t entered the path and filename correctly in the inputbox. You could replace the first line with

              Code:
              With Application.FileDialog(msoFileDialogFilePicker)
                .Filters.Clear
                .Filters.Add "Word templates", "*.dot"
                .InitialFileName = Options.DefaultFilePath(wdUserTemplatesPath)
                If .Show = False Then
              	Exit Sub
                End If
                strNameOfNewTemplate = .SelectedItems(1)
              End With

              This will force you to select a valid template.

            • #1816668

              Hi,

              I did the same thing but with new it works fine.

              Now, in below given code, highlighted line gives error ” Object varaible or With block variable not set”

              With docNew
              .Activate
              .Range.SetRange Start:=wdEndOfDocument, End:=wdEndOfDocument
              Selection.TypeText strCopiedText
              Selection.TypeParagraph
              End With ‘ docNew
              Next intParaCount

              One more question, do i need to save the document with the same name as that of the template.

              regards
              abhilasha

            • #1816669

              Do you still have the line

              Set docNew = Documents.Add(Template:=strNameOfNewTemplate, NewTemplate:=False)

              Without that, the .Activate line will cause an error.

              You shouldn’t save the new document with the same name as the template. You can save it under another name, if you wish, or leave it to the user to save it.

            • #1816670

              Hi,

              If I keep this line in code then same “word was unable to read this doc’ error appears.

              If I remove this line and the newly suggested code then .activate line gives error.

              it prompts me to save the file, and if i provide some other name instead of the template it does not accept and process stops.

              Do you still have the line

              Set docNew = Documents.Add(Template:=strNameOfNewTemplate, NewTemplate:=False)

              Without that, the .Activate line will cause an error.

              You shouldn’t save the new document with the same name as the template. You can save it under another name, if you wish, or leave it to the user to save it.

            • #1816671

              I don’t understand what’s going on. If you can open the template directly, you should be able to create a new document from it using code. I have no idea why it fails.

              If you wish, you can attach a zip file with a copy of the template and of the document with the code (remove sensitive information).

            • #1816672

              Hi,

              Can you please list the steps for doing this activity.

              I don’t understand what’s going on. If you can open the template directly, you should be able to create a new document from it using code. I have no idea why it fails.

              If you wish, you can attach a zip file with a copy of the template and of the document with the code (remove sensitive information).

            • #1816673

              You were able to attach a zip file to [post=”783446″]Post 783446[/post], so why do you need detailed explanations here?

            • #1816674

              I suppose this mail is regarding the other issue i.e. copy the content of any document to in-house template.

              post 783455 is about how to apply code text to all parameter names.

              You were able to attach a zip file to [post=”783446″]Post 783446[/post], so why do you need detailed explanations here?

            • #1816675

              I can’t offer further assistance without seeing the template and the code.

    • #1777103

      The bad news: You don’t want to know!
      Word’s automatic numbering is broken, especially for documents edited by numerous people on numerous computers.

      The good news: There is information and help available. First, take a look at the following two web pages and download them both in Word form.

      Word’s numbering explained:
      http://www.mvps.org/word/FAQs/Numbering/Wo…ngExplained.htm%5B/url%5D
      How to create a template (part 2)
      http://www.mvps.org/word/FAQs/Customizatio…mplatePart2.htm%5B/url%5D
      Both are written by the same technical writer who really knows (and hates) Word numbering but has it almost tamed.
      The second one has a template for a technical manual that has built-in styles that are very stable. You can modify the numbering style in the template to fit what you need to be doing.

      You may also want to look at the following chapters from the Legal Users’ Guide to Microsoft Word:
      http://www.addbalance.com/usersguide/numbering.htm%5B/url%5D
      http://www.addbalance.com/usersguide/templates.htm%5B/url%5D
      http://www.addbalance.com/usersguide/styles.htm%5B/url%5D

      Hope this helps.

    Viewing 1 reply thread
    Reply To: new template cleanup?!?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: