Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    KTYorke
    Guest

    new template cleanup?!?

    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. [img]/w3timages/icons/sick.gif[/img] 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 [img]/w3timages/icons/sick.gif[/img] [img]/w3timages/icons/spook.gif[/img])

    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. [img]/w3timages/icons/doh.gif[/img] 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

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: new template cleanup?!?

    Hi KT,

    Yow - this sounds like a nightmare.[img]/w3timages/icons/scream.gif[/img]

    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![img]/w3timages/icons/yikes.gif[/img].

    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![img]/w3timages/icons/spook.gif[/img]

    Hope this helps,
    Gary

  3. #3
    KTYorke
    Guest

    Re: new template cleanup?!?

    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...[img]/w3timages/icons/sick.gif[/img]

    The problem with creating a macro is time... I'm no Andrew Lockton[img]/w3timages/icons/clever.gif[/img] or Gary Frieder[img]/w3timages/icons/clever.gif[/img] 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[img]/w3timages/icons/laugh.gif[/img]

    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.[img]/w3timages/icons/doh.gif[/img] 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 [img]/w3timages/icons/baby.gif[/img] Thanks for all your help though! It's always appreciated more than you know!!
    have fun

  4. #4
    MichaelCollins
    Guest

    Re: new template cleanup?!?

    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

  5. #5
    KTYorke
    Guest

    Re: new template cleanup?!?

    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.[img]/w3timages/icons/doh.gif[/img] [img]/w3timages/icons/scream.gif[/img]

    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

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: new template cleanup?!?

    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.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #7
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, BC
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: new template cleanup?!?

    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.

  8. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: new template cleanup?!?

    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.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  9. #9
    KTYorke
    Guest

    Re: new template cleanup?!?

    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...[img]/w3timages/icons/doh.gif[/img] [img]/w3timages/icons/scream.gif[/img]
    have fun (I know I'm trying)
    KT

  10. #10
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: new template cleanup?!?

    [img]/w3timages/icons/scream.gif[/img]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.

    [img]/w3timages/icons/grin.gif[/img]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
    How to create a template (part 2)
    http://www.mvps.org/word/FAQs/Customizatio...mplatePart2.htm
    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
    http://www.addbalance.com/usersguide/templates.htm
    http://www.addbalance.com/usersguide/styles.htm

    Hope this helps.
    Charles Kyle Kenyon
    Madison, Wisconsin

  11. #11
    Lounger
    Join Date
    Mar 2009
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    [quote name='MichaelCollins' post='7566' date='23-Jan-2001 10:03']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[/quote]

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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?

  13. #13
    Lounger
    Join Date
    Mar 2009
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


    [quote name='abhilasha' post='782574' date='01-Jul-2009 16:54']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[/quote]

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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.

  15. #15
    Lounger
    Join Date
    Mar 2009
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •