Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Glasgow, Scotland
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding and replacing a Style in a Word doc. (Word 2000 SP2)

    I have a significant number of Word documents that have a particular style. I would like to run some code that would search the active document for a certain style and and replace it with another style and then save the document. Can anyone help with this ?

    Regards

    John

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

    Re: Finding and replacing a Style in a Word doc. (Word 2000 SP2)

    John,

    You shouldn't need to use code to do this - just use Word's find and replace feature.
    Click on Edit > Replace.
    At the bottom of the dialog, there will be a button 'More'.
    Click on this, then click on the 'Format'.
    Click on 'Style...' on the popup menu that appears.

    Basically you need to designate a style to find and a style to replace it with.
    Leave the find and replace text boxes empty.
    Then click on Replace All.
    Then Save the document.

    If you were determined to have a macro to save these steps, use the macro recorder to record your doing these steps in one document. You should then be able to reuse the recorded macro in the other documents.

    Gary

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Glasgow, Scotland
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding and replacing a Style in a Word doc. (Word 2000 SP2)

    Gary,

    Thanks very much for this. I have tried this and it works except that when I view the document after I "Replace All" the original style is still showing, in other words I have said replace style 1 with style 2, I am told Word has made 41 replacements but on viewing the document style 1 is still showing. Am I missing something?

Posting Permissions

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