#1
|
|||
|
|||
Tricky wildcard search
Hi,
I just read Paul's answer to a wildcard Seach & Replace issue https://www.msofficeforums.com/word-...ve-spaces.html, which led me to one of my 'Search & Replace using wildcards' questions. I need to find a "*" within a string (possible) followed by any charcater or digit (possible) within table cells (table cell marker as 'delimiter'). The string after the "*" has to be deleted (replace "*", possible ). The problem is not the first part of the pattern, but the restriction to a table cell. I tried '^7' as well as 'Chr(7)', but both don't work. Right now I'm using a VBA procedure, but simple Search & Replace would be much better - in this specific case. Thanks NP |
#2
|
||||
|
||||
There is no wildcard expression that limits itself to what is in a table; indeed, you can't even use ^13 for something that depends on a terminating paragraph break if what you're after could be attached to the end-of-cell marker.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Any chance of restricting the search/replace to a table cell style?
|
#4
|
|||
|
|||
Hi,
I don't see how a style could help? The problem still remains the same: the search has to find the part of the string after "*" until the end of the cell and replace/delete it with "*". And this has to happen within all tables/cells within the doc. Would be great if there were a solution without VBA, but ... NP |
#5
|
||||
|
||||
Quote:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
I meant, text styles such as tableHead, table Cell, tableCaption applied to the content of the table. Sorry for the terminology glitch!
|
#7
|
||||
|
||||
Presumably they're custom paragraph/character Styles, as they're not built-in Styles. Any Find, wildcard or otherwise, can be limited to any paragraph/character Style.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Just to check my assumptions, I prepared this simple example. The paragraphs use my standard body text style, the table cells use :ttx for table content. This does at least get me as far as being able to find * only inside a table cell; so if I knew how to use \*.* in a Word regex, I'd hope this would do the trick cell by cell.
Let me know! this would be a useful trick to have up my sleeve. |
#9
|
||||
|
||||
Clear as mud! Perhaps you could attach a document to a post showing what you mean?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
Yes, it would be easier with the attachments, wouldn't it …
|
#11
|
||||
|
||||
Finding a paragraph with an asterisk (or, preferably, any other character - asterisks are harder to work with) isn't at all hard but that's not the same as restricting Find operations to table content, which is what NobodysPerfect is after. The problem with tables, though, is that you can't do any Find that involves a final paragraph break that also works with end-of-cell markers - or even with end-of-cell markers.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tricky bookmark and bullet question | skroser | Word | 1 | 07-09-2013 08:28 AM |
Tricky IF formula | twolfend | Excel | 1 | 12-05-2011 09:02 AM |
Tricky Word problems | Eva | Word | 3 | 10-14-2011 03:18 AM |
Wildcard Problem with Emailadresses | Fmax | Word | 1 | 06-17-2010 06:09 AM |
Wildcard search help. | Kempston | Word | 0 | 11-13-2009 03:58 AM |