Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2016, 12:15 PM
Cosmo Cosmo is offline Having problems with a Wildcard search Windows Vista Having problems with a Wildcard search Office 2007
Competent Performer
Having problems with a Wildcard search
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Thanks, I haven't had a chance to check that out just yet. Unfortunately, they have just thrown yet another monkey wrench into the deal.



I now have an optional couple of words which will appear AFTER the parentheses, and although I know what the 2 words will be, I don't know what will be following, so I cannot use what worked above by looking for characters that are not '(' or ')'.

So, now I'm looking for the following:

'BRAND® XXL (sub brand text) EXACT TEXT' continued sentence text...

Where both 'XXL' and 'EXACT TEXT' are variable (and will always be used together; either they are both included or both excluded).

It looks like i may very likely need to use Regular Expressions, which I have used once or twice before in VBA, but for parsing text in variables, not in a word document find/replace. My biggest concern is how reliably can I know/assume that the vbscript Regular Expressions library that I am using is installed on the user's system? Is this installed with the Windows OS, and is it something that their IT could have omitted from their install?



There's also another wrinkle to the problem that I just found out about, in that the first mention of each version on each page needs to be the full text. I don't believe that should be a problem as I can check each found set, and keep track of whether that version has been shortened for each page. Edit: I got this part working properly, so this is no longer an issue.

Last edited by Cosmo; 02-12-2016 at 02:47 PM.
Reply With Quote
  #2  
Old 02-12-2016, 02:23 PM
Cosmo Cosmo is offline Having problems with a Wildcard search Windows Vista Having problems with a Wildcard search Office 2007
Competent Performer
Having problems with a Wildcard search
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

After a little digging, I don't even know if I will be able to use the Regular Expressions to do what I need. The native Find/Replace in Word can't use the regular expression, and I don't think that I can use the Regular Expression replace to step through each found value like I am currently. I only see a .Replace method, and I haven't found any example code online that doesn't do a 'replace all'.

So, my questions are boiled down to these:

Am I able to step through each found string using a Regular Expression object and decide in my VBA when to do the replace? If so, can you point me to an example of how to do this?

Is the Regular Expressions library definitely installed in every target machine, or is there a possibility that it isn't available?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with wildcard search mysterytramp Word 0 05-13-2015 10:40 AM
Where is the error in my wildcard search? Ulodesk Word 10 06-30-2014 01:46 PM
Having problems with a Wildcard search Wildcard search fails in table NobodysPerfect Word VBA 4 06-11-2014 11:02 AM
Having problems with a Wildcard search Tricky wildcard search NobodysPerfect Word 10 03-19-2014 04:29 AM
Wildcard search help. Kempston Word 0 11-13-2009 03:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft