Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding Special characters in Textboxes

    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?

  2. #2
    BAM
    Guest

    Re: Finding Special characters in Textboxes

    Hi Rajesh,

    You would need to turn the text boxes into Frames. Right-click the text box, select Format Text Box and on the Text Box tab you'll find the "Convert to Frame" command.

    Personally I use Frames instead of Text Boxes due to these types of limitations.

    I don't know why they took the Insert/Frame command off the Insert Menu and Drawing toolbar, but it's easy to add back.

    Just display your Forms toolbar, hold <Alt + Ctrl> and drag the "Insert Frame" command to any toolbar.
    ~~~~~~~~~~~
    Cheers!

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding Special characters in Textboxes

    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.

  4. #4
    BAM
    Guest

    Re: Finding Special characters in Textboxes

    <<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.>>

    That I don't know... :-(

    Maybe someone else has another suggestion??

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

    Re: Finding Special characters in Textboxes

    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...)

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

    Re: Finding Special characters in Textboxes

    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

  7. #7
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding Special characters in Textboxes

    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.

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

    Re: Finding Special characters in Textboxes

    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.

    <pre>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
    </pre>

    Gary

  9. #9
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding Special characters in Textboxes

    Thanks a heap, yet again, Gary

    I will try out this macro ASAP.

Posting Permissions

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