Yuraj Posted October 14, 2006 Share Posted October 14, 2006 (edited) I use the RTF Plugin (Lazycat) for syntax word. How to automatic detection type (RTF Plugin) and replace the searched string (e.g.:SimpFunc) as colored or bold word? Sample:Blaa text SimpFunc Blaaa text Edited October 14, 2006 by Yuraj ShellExecute("http://www.yuraj.ucoz.com")ProcessClose(@AutoItPID) Link to comment Share on other sites More sharing options...
Xenobiologist Posted October 14, 2006 Share Posted October 14, 2006 Hi, try this: $path = "file.doc" $search = "" $replace = "" $Word = ObjCreate("Word.Application") $Word.Documents.Open($path) With $Word.Selection.Find .ClearFormatting .Replacement.ClearFormatting ;~ expression.Execute(FindText, MatchCase, MatchWholeWord, MatchWildcards, &_ ;~ MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace,&_ ;~ MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl) .Execute($search, false, false, false, false, false, true, false, false, $replace, 2) EndWith $Word.Activedocument.Save() $Word.Activedocument.Close $Word.quit So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Yuraj Posted October 14, 2006 Author Share Posted October 14, 2006 I'm thought only RTF Plugin by Lazycat (GUICtrlCreateRTFEdit). ShellExecute("http://www.yuraj.ucoz.com")ProcessClose(@AutoItPID) Link to comment Share on other sites More sharing options...
Yuraj Posted October 14, 2006 Author Share Posted October 14, 2006 Ok,in details (If i use the hotkey F1, then replace only word ,,SimpFunc,, to colored - e.g.Green ,,/SimpFunc/,,. Problem is in, that replacing all words...): #include <GuiConstants.au3> #include "RTF_writer.au3" $Hot=HotKeySet("{F1}","HotKey") $hPlug = PluginOpen ("rtfplugin.dll") $hGUI = GUICreate("RTF plugin test", 600, 340) $hEdit = GUICtrlCreateRTFEdit($hGUI, 0, 0, 600, 300, -1, 0x20000) $Msg=ControlCommand ("RTF plugin test", "", "RichEdit20A1", "GetSelected") GUISetState() ;SynTax func HotKey() $Get=GuiCtrlRTFGet($hEdit) local $out = _RTFCreateDocument("MS Sans Serif") $Main=ControlGetText("RTF plugin test","","RichEdit20A1") $T1="/SimpFunc/" $T="SimpFunc" $UPD=StringReplace($Main,$T,$T1) $PD=$UPD $out0 = _RTFAppendString($out,$PD, 0x00FF00, 12, 1, "MS Sans Serif") GUICtrlRTFSet($hEdit, $out0, 0) Sleep(100) EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd exit(@error) ShellExecute("http://www.yuraj.ucoz.com")ProcessClose(@AutoItPID) 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