Suppir Posted May 10, 2010 Share Posted May 10, 2010 Hello!I know about _WordDocFindReplace () which does search-replaces in doc-file with instruments of MS Word.But is it possible to do search-replaces with AutoIt regular expressions (StringRegExpReplace) in doc-file?Thanks! Link to comment Share on other sites More sharing options...
Suppir Posted May 10, 2010 Author Share Posted May 10, 2010 (edited) for example, I know how to do replaces with regular expressions in HTML-pages:#include<IE.au3> $oIE = _IECreate($someInternetLink, 0, 0) $oSpans = _IETagNameGetCollection ($oIE, "span") ;~ ConsoleWrite(@extended) For $oSpan In $oSpans $sOutput = StringRegExpReplace($oSpan.innerText, "\s+", " ") _IEPropertySet($oSpan,"innertext", $sOutput) Next $sHTML = _IEDocReadHTML($oIE) $dFile = FileOpen($sPath,2) If $dFile = -1 Then Exit FileWrite($dFile, $sHTML) FileClose($dFile)but how to do the same thing in doc(x) files? Edited May 10, 2010 by Suppir Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now