Search and regular expression help!

N

notanoobreally

Hiya All!!

using wildcard search "

<(inter) finds "interesting" and "intercept", but not "splintered".
(in)> finds "in" and "within", but not "interesting".

any idea how to achieve the following through Perl-style regular
expressions??
any help is much appreciated!

and secondly i m using the following macro

Option Explicit

Public Sub BatchReplaceAll()

Dim FirstLoop As Boolean
Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document
Dim Response As Long
Dim i As Long

PathToUse = "e:\working\"

'Error handler to handle error generated whenever
'the FindReplace dialog is closed

On Error Resume Next

'Close all open documents before beginning

Documents.Close SaveChanges:=wdPromptToSaveChanges

'Boolean expression to test whether first loop
'This is used so that the FindReplace dialog will
'only be displayed for the first document

FirstLoop = True

'Set the directory and type of file to batch process

With Application.FileSearch
..NewSearch
..LookIn = PathToUse
..SearchSubFolders = True
..FileName = "*.doc"
..MatchTextExactly = True
..FileType = msoFileTypeAllFiles

If .Execute() Then

For i = 1 To .FoundFiles.Count

'Open document
Set myDoc = Documents.Open(.FoundFiles(i))

If FirstLoop Then

'display dialog on first loop only

Dialogs(wdDialogEditReplace).Show

FirstLoop = False

Response = MsgBox("Do you want to process " & _
"the rest of the files in this folder", vbYesNo)
If Response = vbNo Then Exit Sub

Else

'On subsequent loops (files), a ReplaceAll is
'executed with the original settings and without
'displaying the dialog box again

With Dialogs(wdDialogEditReplace)
..ReplaceAll = 1
..Execute
End With

End If

'Close the modified document after saving changes
myDoc.Close SaveChanges:=wdSaveChanges

Next i

End If

End With

End Sub



The problem here is that
i use wildcard search.. and in the replacement field i need to change
the font of the replacement char.. so i change it through
more>>format>>font.. but the problem is that when i have to change
this in lots of files.. say 20000 .... the process goes on fine.. but
in a lot of 20000 files.. only 500-600 are actually replaced with the
desired characters... the rest open up.. show everything..
converting...replacing...saving.. all in a batch but does not actually
happen..
i have tried this macron Word 2002 and 2003... but no avail!!

please helpp!!!!!!!!

regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Match style 0
VBA Export to PDF 0
Script 2
macro trouble 3
find and replace in footer 2
Word Macro for multiple searches, incl. in footnotes 2
Help Tweaking a Macro 1
Very Peculiar Macro/batch Problem!!! 3

Top