Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Aug 2011
    Posts
    59
    Thanks
    23
    Thanked 2 Times in 2 Posts

    Replacing a string with bold text

    I've been looking for this solution, but evidently I can't get the syntax correct.

    I have numerous tables in my document and I would like to do a find and replace to bold those occurences.

    Example:
    Table 3.1.
    Table 3.2.
    Table 4.1.
    etc.

    How can I bold the entire string from Table all the way to the period?

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,409
    Thanks
    208
    Thanked 834 Times in 767 Posts
    JRB,

    What you need to do is search using a "Regular Expression".
    Here's a Microsoft Article on Using Regular Expressions in Word.

    Then remember to apply the Format option to the "Replace With".
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  3. #3
    Star Lounger
    Join Date
    Aug 2011
    Posts
    59
    Thanks
    23
    Thanked 2 Times in 2 Posts
    Thank you very much RG for the point in the right direction.

    I got this to work...

    Find= <(Table) [0-9](\.)[\0-9](\.)
    Replace= ^&

    ...but can't seem to grasp how to catch a double number.

    Example: Table 4.12.

    I could do

    <(Table) [0-9](\.)[0-9][0-9](\.)

    but this would catch the Table 4.12. and not the Table 3.1. so I would have to do two searches.

    Any way to do one?

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,409
    Thanks
    208
    Thanked 834 Times in 767 Posts
    JRB,

    I think this will do it for all combos: Find= <(Table) [0-9]{1,}(\.)[\0-9]{1,}(\.)
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  5. The Following User Says Thank You to RetiredGeek For This Useful Post:

    jrb (2012-04-12)

  6. #5
    Star Lounger
    Join Date
    Aug 2011
    Posts
    59
    Thanks
    23
    Thanked 2 Times in 2 Posts
    Yes it does the job quite well.

    I had actually used this before you posted and it works well for my requirements also.

    <(Table) [0-9](\.)[\0-9]{1,2}(\.)

    Much appreciated.

Posting Permissions

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