I am trying to print a message in LibreOffice Writer with python, using the function
win32gui.SendMessage(window_id, win32con.WM_CHAR, ord('a'), 0)
The expected result in notepad:
The result in Libreoffice Writer
The character "a" was printed 65536 times.
I have also tried using the PostMessage function instead of the SendMessage, as well as the below way of printing
win32gui.PostMessage(window_id, win32con.WM_KEYDOWN, ord('a'), 0)
time.sleep(0.1)
win32gui.PostMessage(window_id, win32con.WM_KEYUP, ord('a'), 0)
The results were the same.

