Page 11 of 11

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

Posted: 26 Aug 2019, 15:53
by hasantr
just me wrote:
26 Aug 2019, 06:46
What about RE.SetText(...)?
SetText does not work with Windows 10. ReplaceSell with windows 7. :crazy:

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

Posted: 24 Oct 2022, 11:45
by m3user
I'm using this class for years and it's still great.

I need to split rtf code into two parts. Due to specific rtf structure this would be difficult (any idea is welcome), therefore I thought this class could help.

The idea is to open rtf code in the editor (hidden), find specific position at which the file would split (specific unique string, for example #BREAK#), delete the part after the position and save with GetRTF() function. Then I would do the same for the other part by removing the part before the position and get rtf again.

Are there any functions which would help with this? Finding the string position, deleting a part before or after the position? Thanks!

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

Posted: 07 Dec 2022, 06:11
by fuglen
Looks great for my use where I need to open a table to edit. My question is, how do I run "RichEdit_sample.ahk" so it inserts a specific file from the beginning?

Lets say I have another gui with a button. When I click the button I want "RichEdit_sample.ahk" to run and "C:\Users\user\Desktop\RichEdit\Test.rtf" to be inserted. I can´t figure out how to insert a specific file without using the menu

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

Posted: 08 Dec 2022, 02:12
by just me
@fuglen,

try to change the script as follows (not tested):

Code: Select all

; The rest
Gui, Add, Statusbar
SB_SetParts(10, 200)
GuiW := GuiH := 0
File := "C:\Users\user\Desktop\RichEdit\Test.rtf"                 ; <<<
If FileExist(File) {                                              ; <<<
   RE2.LoadFile(File, "Open")                                     ; <<<
   RE2.SetModified()                                              ; <<<
   Open_File := File                                              ; <<<
}                                                                 ; <<<
Gui Show, , % GuiTitle . (Open_File ? " - " . Open_File : "")     ; <<<
OnMessage(WM_MOUSEMOVE := 0x200, "ShowSBHelp")
GuiControl, Focus, % RE2.HWND
GoSub, UpdateGui
Return
; ======================================================================================================================
; End of auto-execute section
; ======================================================================================================================

Re: Class RichEdit - update on 2015-04-14 (v0.1.05.00)

Posted: 08 Dec 2022, 09:58
by fuglen
@just me
Works like a charm. Thank you!