• Find/Replace not working with styles (Word 2002/XP SP-2)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Find/Replace not working with styles (Word 2002/XP SP-2)

    Author
    Topic
    #378531

    Hi,

    I have a template which has worked fine up to now in Word 2000. We’ve just rolled out Office XP to some users. It’s stopped working correctly in this instance.

    The intention is to remove all hidden text. In real life, it’s attached to the FileClose event. Also, in real life, we force the “View Hiddent text” option to “On”.

    What is happening to this particular document is that it removes all NON-HIDDEN text instead. This could be disastrous.

    If I remove the table at the front of the document, it seems to work OK. But I need to have a solid clue as to why it’s happening- otherwise it could happen again.

    Note. My apologies- it is actually a Doc template (.dot) but I could not load that, so I had to rename it to “.doc”.

    Note that the document does have a section break. The document is normally protected, and the macro would unprotect it.

    If I position the cursor in the section break, it workd correctly.

    And I’ve just noticed the same behaviour now that I’ve saved it and run it in Word 2000.

    And my apologies. It is actually a template (.dot) which I’ve had to rename to “.doc” to enable me to load it into the lounge.

    Viewing 2 reply threads
    Author
    Replies
    • #626922

      Hi Geoff:
      I’ve been playing with your template in Word 2000. While I’m not sure what, something is wrong with your template. It should work. However, when I use the same macro in another document (not based on your template), it works every time. When I try it with your template, it removes the non hidden text almost every time. I’m not sure what I did to make it work the one time it did. I don’t have any more time tonight as I’m falling asleep, but I’ll let you know if I find anything (after I awake) grin

    • #626924

      Geoff

      [Editted by Andrew]

      I’ve got no idea of the cause either. However, I could ‘fix’ it by coding

      ActiveDocument.Content.Select

      Prior to the Selection.find statements.

      I assume that the template’s state is odd – but cannot explain it. bummer

      • #627077

        Andrew,

        That works in my first quick trial. I shall pass it on to the person whjo is testing.

        Thanks.

    • #626927

      Hi Geoff, I’m running Win&Ofc XP [however, I did NOT install the SP’s …]. FYI – I tested our your ‘doc-dot’ and your macro worked for me removing the hidden text and leaving my entered text.

      • #626985

        It worked for me as a .DOC, but failed as a .DOT – my assumption is that it somehow relates to the attributes of a template. bummer

        • #626992

          Odd. I tried it both as dot and doc. Tried again saving Geoff’s doc as .dot, protected for forms, and works great. I was sceptical of SP’s given what I’ve read so I’m wondering if it might have something to do with the patch(es) which sometimes break more than they fix? scratch

    Viewing 2 reply threads
    Reply To: Find/Replace not working with styles (Word 2002/XP SP-2)

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

    Your information: