• Finding Special characters in Textboxes

    Author
    Topic
    #354753

    I am trying to find (Word 2000) thin spaces in a file, but it does not find those within textboxes contained in the file. What is the solution?

    Viewing 1 reply thread
    Author
    Replies
    • #521855

      What do I do for linked text boxes which contain long tables which exceed one page in size? Converting them to frames does not help.

      • #522382

        Rajesh,

        I was about to try for a macro to do this, but it looks like the following works:

        Click insertion point at the beginning of the first linked textbox. Do a Find/Replace All from there – this will run through the entire group of linked textboxes in one pass.

        Just out of curiosity – how are you inserting a thin space, and how are you doing a find on it?

        Gary

        • #522443

          Thanks, Gary, for your valuable input.

          I know I need to go to every group of linked textboxes and do it — that is what I did ultimately. That was the pain I wanted to avoid, because I wanted to create a macro which could run on a batch of Word 2000 files and remove thin spaces which are not supported in Word 97, and save as RTF for conversion to Word 97.

          A thin space is Unicode No 8197 (in ANSI, both a thin space and a keyboard space have place value of 32) and pasting a thin space from Clipboard into the Find Box seems to work.

          Replacng a thin space is another problem. I use ^c in the replace box after copying a thin space to clipboard before running the s & r operation — clumsy, but it works.

          • #522576

            Hi,

            In case it’s any help, the following macro can be used to do Find/Replaces in all textboxes in a document; however it will error if any of the textboxes are grouped.

            Sub GetToTextBoxText()
            'Gary Frieder  April 2001
            'Warning: this code will error if there are grouped text boxes
            Dim aShape As Shape
            Dim objTxtRng As Range
            For Each aShape In ActiveDocument.Shapes
                Set objTxtRng = aShape.TextFrame.TextRange
                    With objTxtRng
                        With .Find
                            .ClearFormatting
                            .Replacement.ClearFormatting
                            .Text = "FindText"
                            .Replacement.Text = "ReplaceText"
                            .Forward = True
                            .Wrap = wdFindContinue
                            .Format = False
                            .MatchCase = False
                            .MatchWholeWord = False
                            .MatchWildcards = False
                            .MatchSoundsLike = False
                            .MatchAllWordForms = False
                            .Execute Replace:=wdReplaceAll
                        End With
                    End With
            Next aShape
            End Sub
            

            Gary

            • #522630

              Thanks a heap, yet again, Gary

              I will try out this macro ASAP.

    • #521897

      You should be able to do this via a macro, where you set a range to the wdTextFrameStory and then do the find on that range.
      (I’ll try to post a code sample when I get a few moments later, if that helps.)
      (And I also remember an earlier macro that did something like this, that ran into complications when it encountered grouped textboxes – not sure what complications linked textboxes might introduce…)

    Viewing 1 reply thread
    Reply To: Finding Special characters in Textboxes

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

    Your information: