TheDewd wrote: ↑16 Oct 2018, 07:58
Can you explain what you are trying to achieve using Word? What purpose is the macro fulfilling? There might be a way to do everything in AutoHotkey without the use of Word.
Sorry I didn't answer your original request. I just thought I would see if you can provide more information in the case we can make your task easier than your current methods...
Sorry for not answering sooner, I had problems with my connection.
The macro applies word's auto-correct to the text. I found that 95% the suggestions were correct and I'm trying to use word's auto-correct in Notepad (and why not, other programs) as well. The Word macro (not really relevant, but just in case someone might need it):
Sub IseParandi()
Dim rng As Range
Dim i As Long
For i = 1 To ActiveDocument.Range.SpellingErrors.Count
Set rng = ActiveDocument.Range.SpellingErrors(i)
If rng.GetSpellingSuggestions.Count <> 0 Then
rng = rng.GetSpellingSuggestions.Item(1).Name & "ZXQ"
End If
Next i
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "ZXQ"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I made a rudimentary ahk script that sent the text to word, applied the macro and got it back to notepad, but it also created a new word document window each time, so it was very slow and cumbersome. I wondered, if there's a more clever solution to it.