Jump to content

Recommended Posts

Posted

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!

Posted (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 by Suppir

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...