Is there a way to detect text information on notepad and Microsoft Word? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Micromegas
Posts: 219
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Is there a way to detect text information on notepad and Microsoft Word?

06 Oct 2019, 06:18

What kind of text information do you mean? If you need the selected text you can use clipboard, as in the following:

Code: Select all

SendInput ^c
ClipWait 0.3
MsgBox % Clipboard
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: Is there a way to detect text information on notepad and Microsoft Word?  Topic is solved

06 Oct 2019, 06:30

If for text information you mean the text content you can use this

Code: Select all

; to get the text in active Notepad window
ControlGetText,tx,Edit1,ahk_class Notepad
MsgBox %tx%
; to get the text in active Word document
oWord := ComObjActive("Word.Application")
MsgBox % oWord.Activedocument.Range.Text
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode

Return to “Ask For Help”

Who is online

Users browsing this forum: CarPiotr, TAC109 and 59 guests