Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Burpengary, Queensland, Australia
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy Styles (Word 2000)

    Hi all you gurus out there!

    I have a little issue which I am trying to fix.

    When I open documents, I want to be able to assign the correct styles to each document from the Normal.dot file. These documents have obviously been created with an old normal.dot.

    My issue is how?????

    I recorded a macro which copies the style from normal.dot file to the file that I had open at the time of the creation of the macro. Is there a code which I can use which will make this change from a named document (eg C:trishword.doc) to Active.Document??????

    I also (in the macro) select the whole of the text of the document and then assign the copied style to it. Can anyone tell me why the style does not apply to the whole document but only the first line of the relevant document.

    Any help that anyone can give would be highly appreciated.

    Many thanks in advance!!

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

    Re: Copy Styles (Word 2000)

    The VBA code to reimport all the styles from the attached template is a one liner but I have made it a little murkier to ensure that there is no other template attached before you run the important command.
    <pre>Sub RefreshStylesFromNormal()
    With ActiveDocument
    .AttachedTemplate = Application.NormalTemplate
    .UpdateStyles
    End With
    End Sub</pre>

    Did you actually want all styles from Normal or just one. The second part of your question makes it look like you only want one style to come into the file and then apply that style to the entire document. Post the code you have created so we can suggest the fix.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Burpengary, Queensland, Australia
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy Styles (Word 2000)

    Thank you Andrew,

    That's perfect!

  4. #4
    Lounger
    Join Date
    May 2003
    Location
    San Diego, California, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy Styles (Word 2000)

    (Edited by HansV to activate URL - see <!help=19>Help 19<!/help>) (Thanks HansV - NeuroDoc)

    Here is a link to a nice Freeware template that copies and move four of the features that are held in Word templates - styles, autotexts, toolbars and macros.

    http://www.chriswoodman.co.uk/Shortcut Organizer.htm

Posting Permissions

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