Results 1 to 8 of 8
  1. #1
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.
    Attached Files Attached Files
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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) <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  3. #3
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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. <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15>

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Toronto, Ontario
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.

  5. #5
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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. <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15>

  6. #6
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Toronto, Ontario
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    <big> <font face="Comic Sans MS">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? <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29> </font face=comic></big>

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Andrew,

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

    Thanks.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  8. #8
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    I think it's a bug that also infests previous versions; see thisn thread for other work-arounds you could try.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

Posting Permissions

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