+ Reply to Thread
Results 1 to 6 of 6

Ignore registered and trademark symbols when executing a find in Word from Excel

  1. #1
    Registered User
    Join Date
    01-23-2025
    Location
    Vejle, Denmark
    MS-Off Ver
    365
    Posts
    2

    Ignore registered and trademark symbols when executing a find in Word from Excel

    Hi fellow coders...

    I've written some code to take a column of keywords (comprising one or more words) and highlight all occurrences in a Word document that I open by creating a Word object. The code successfully opens the file and finds the keywords if they are an exact match. The issue is that some of the keywords in the Word doc include IP-related names, so if the keyword is, e.g. Fisher Price toy, the term Fisher Price® toy in the Word doc would not be picked up.

    The .IgnorePunct property only matches if the only difference is something like a full colon (which makes sense). I've experimented with the .MatchFuzzy properties, but the one I thought would work (.MatchFuzzyWord) returns a "Runtime Error 438: Object doesn't support this property or method". Is this an issue because I'm calling it from Excel?

    I would also like to catch singular vs plural differences, as the current properties aren't doing that, e.g. keyword=Fisher Price toy, Word doc=Fisher Prices toys

    I have added the Word reference library.


    Here's the part of my code with the .Find properties...

    Please Login or Register  to view this content.
    Looking forward to being enlightened
    Last edited by tlangford; 01-23-2025 at 08:45 AM.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Ignore registered and trademark symbols when executing a find in Word from Excel

    Have you tried .MatchWholeWord = False ?

    If that doesn't give satisfactory results you could:
    1. create a sheet that has search name variations.
    2. when you bring in data, run a routine that removes all the unwanted characters.

    Hope this helps.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,842

    Re: Ignore registered and trademark symbols when executing a find in Word from Excel

    You could use code along the lines of:
    Please Login or Register  to view this content.
    This will match strings that may or may not include registered marks, trade-marks, & copyright symbols.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,842

    Re: Ignore registered and trademark symbols when executing a find in Word from Excel

    With the previous code, insert:
    Please Login or Register  to view this content.
    after:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-23-2025
    Location
    Vejle, Denmark
    MS-Off Ver
    365
    Posts
    2

    Re: Ignore registered and trademark symbols when executing a find in Word from Excel

    Thanks for the input. Now that I'm able to identify variations of a keyword (with and without the symbols), the next issue I have is highlighting them in the in Word doc. I need to...

    search for a keyword with/without the symbols
    if it finds a match, highlight the characters in the Word doc (it needs to highlight the correct number of characters, depending on whether the matching keyword includes one or more of the symbols)
    repeat for all keyword/symbol permutations

    I've created some code but it's highlighting the wrong characters, so it's not keeping track of how many characters each matching keyword comprises (with/without one or more symbols). Can I use len(strFnd) to identify how many characters I need to highlight using range.selection?

    thanks
    Tony

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,842

    Re: Ignore registered and trademark symbols when executing a find in Word from Excel

    How about posting the code? It's pretty hard to tell you how to revise it when we can't see it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel VBA not executing in Word
    By smit3446 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-20-2017, 04:07 PM
  2. How to get excel to ignore math symbols
    By 3genav in forum Excel General
    Replies: 3
    Last Post: 11-16-2014, 04:05 PM
  3. [SOLVED] Insert excel data source into word doc using currency symbols
    By Ginny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 03:05 AM
  4. [SOLVED] Insert excel data source into word doc using currency symbols
    By Ginny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 01:05 AM
  5. [SOLVED] Insert excel data source into word doc using currency symbols
    By Ginny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 12:05 AM
  6. [SOLVED] Insert excel data source into word doc using currency symbols
    By Ginny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] Insert excel data source into word doc using currency symbols
    By Ginny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1