Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2010, 05:37 AM
pochtara pochtara is offline Issue skipping characters by Regular Expressions in Word Windows XP Issue skipping characters by Regular Expressions in Word Office 2007
Novice
Issue skipping characters by Regular Expressions in Word
 
Join Date: Apr 2010
Posts: 1
pochtara is on a distinguished road
Post Issue skipping characters by Regular Expressions in Word

When using Regular Expression search using VBA script in Excel to search Word document, "-" character in the word document gets skiped (substituted with "" empty character).
Here is the string in Word: <DE4.0><SWR4.4.l‑CE6:A>
Here is the snipet of VBA code used:
With Selector.Find


.text = "\<DE?*^13"
.Replacement.text = ""
.Forward = True
.Wrap = wdFindzz
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With

The search find the string in the Word and here is the resulting string in the VBA: <DE4.0><SWR4.4.lCE6:A>

As you can see the "-" hyphen character is missing in the resulting string and I can't understand why and how to fix it.

Can someone help me with this?
Thanks
Alex

P.S. I've attached the Word and Excell document that I'm using if someone wants to try it.
The VBA macro in Excel that does this work called DEExtract. Put a breakpoint on the line 250 ( While Selector.Find.Execute) and after that Selector.text will show the search result. To execute it, click on the "Import Design Elements" on the Design Elements tab and then select the word document.
Reply With Quote
Reply

Tags
excel formatting, regular expression, word 2007

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue skipping characters by Regular Expressions in Word regular expressions in footnotes loes Word 3 09-04-2019 07:52 AM
Regular expressions and field codes Cosmo Word VBA 5 04-20-2018 04:10 PM
Word Regular Expressions: zero or more occurences? tinfanide Word 6 09-16-2015 03:13 PM
regular expressions for empty lines eNGiNe Word 1 01-21-2013 06:38 AM
Issue skipping characters by Regular Expressions in Word Regular Expressions: [!0-9] does not work??? tinfanide Excel Programming 4 05-30-2012 04:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:14 AM.


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