Page 1 of 1

Search Replace inside Word and Excel VBA Code Modules

Posted: Wed Apr 22, 2009 10:02 am
by DataMystic Support
WordPipe and ExcelPipe now support search/replace inside Word and Excel VBA Code Modules.

You need to check the Look In location Code Modules.

You can perform a literal (exact) match using the Search Type Normal search.

Or, you can perform a pattern match using Search Type EasyPattern Wildcards or Perl regexWildcards.

As an example, to replace a subroutine called Sub HelloTest() with a new definition,

Using EasyPattern Wildcards (http://www.datamystic.com/easypatterns_reference.html), set the search text to:

Code: Select all

Sub HelloTest()[ 1+ chars ]End Sub
and set the replacement text to the new definition (you can paste a multi-line replacement function from the windows clipboard).

Using Perl regexWildcards, , set the search text to:

Code: Select all

Sub HelloTest\(\).*End Sub
and set the replacement text to the new definition.

Re: Search Replace inside Word and Excel VBA Code Modules

Posted: Fri Apr 26, 2013 6:10 am
by yangkwak
Hello,

I couldn't get WordPipe to replace my sample macro.
My sample script is as follow,

Sub TestMacro001()
'
' TestMacro001 Macro
'
'
MsgBox ("hello word! \Desktop App Readiness Test Documents\")

End Sub


"Code Modules" in checked.
And Find What is "\Desktop App Readiness Test Documents\"
Replace With is "\Desktop App Readiness Test Documents\subfolder001\"

I've tried various option but couldn't make it work. Any advice on what I am doing wrong?

Also, does it not work if I select ALL options in "Look in"?

Re: Search Replace inside Word and Excel VBA Code Modules

Posted: Sat Apr 27, 2013 7:46 am
by DataMystic Support
Can you send a test document and your WordPipe settings (File\Save As, .wpp file) to our support address?

Also, which version of WordPipe, Windows, and of MS Word is this?