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

Post your working scripts, libraries and tools for AHK v1.1 and older
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

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

Post by hasantr » 26 Aug 2019, 15:53

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

m3user
Posts: 235
Joined: 17 Jan 2014, 18:11

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

Post by m3user » 24 Oct 2022, 11:45

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!

fuglen
Posts: 24
Joined: 05 Mar 2020, 09:44

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

Post by fuglen » 07 Dec 2022, 06:11

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

just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

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

Post by just me » 08 Dec 2022, 02:12

@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
; ======================================================================================================================

fuglen
Posts: 24
Joined: 05 Mar 2020, 09:44

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

Post by fuglen » 08 Dec 2022, 09:58

@just me
Works like a charm. Thank you!

Post Reply

Return to “Scripts and Functions (v1)”