Suppir Posted November 27, 2009 Share Posted November 27, 2009 (edited) Hello!I want to use regular expressions to change text in GuiRichEdit control. But it works fine only outside ms-word tables. These tables are crushing into plain text Look at this code:expandcollapse popup#include <UDF\GuiRichEdit.au3> #include <GUIConstants.au3> $Form1 = GUICreate("Form1", 800, 600, 300, 200) $hRichEdit = _GUICtrlRichEdit_Create($Form1, "", 0, 0, 800, 600) GUISetState(@SW_SHOW) HotKeySet("^x", "_Replace") HotKeySet("{ESC}", "_Exit") Global $Records Global $Search[1000][2] Global $Matches Global $i, $IN TrayTip ("AutoIt", "Started", 1) sleep(2000) TrayTip("clears any tray tip","",0) While 1 Sleep(100) WEnd Func _Replace() Local $i $Text = _GUICtrlRichEdit_GetCtrlText($hRichEdit) ;~ HERE IS THE PROBLEM! $Text = StringRegExpReplace($Text, "a", "b") _GuiCtrlRichEdit_AppendText($hRichEdit, $Text) ;~ THE TABLE IS NOT MS-WORD-TYPE ANYMORE TrayTip ("AutoIt", "Done", 1) sleep(1000) TrayTip("clears any tray tip","",0) EndFunc Func _Exit() TrayTip ("AutoIt", "Exit", 1) Sleep(1000) Exit EndFunc1. Run the script2. Copy into GUI any ms-word table3. Press CTRL+x4. You see - the table is crushed5. Press ESC to exitIs there some way to save tables? Edited November 27, 2009 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