Hallo, ist es Möglich aus einem MS Outlook Email Nachricht den Nachrichten Text zu kopieren?
Auszug aus Spy Window
xxx xxx - Nachricht (HTML)
ahk_class rctrl_renwnd32
ahk_exe OUTLOOK.EXE^
ClassNN: _WwG1
Text: Nachricht
Color: FFFFFF (Red=FF Green=FF Blue=FF)
x: 9 y: 448 w: 1442 h: 377
Client: x: 8 y: 447 w: 1442 h: 377
Text aus Outlook kopieren?
Moderator: jNizM
-
- Posts: 264
- Joined: 09 Mar 2019, 01:52
- Location: Germany
- Contact:
Re: Text aus Outlook kopieren?
Ich verstehe das nicht. Normalerweise sollte es so gehen.
Aber ich bekomme bei mir auch nur "Nachricht" heraus. Bei der Betreffzeile funktioniert es.
Ich tippe, es liegt an dem Editor, den Outlook im Hintergrund verwendet. Ich kann mir vorstellen, dass das Word ist. Aber das ist nur eine Vermutung.
Also den harten Weg. Wir kennen den Control. Aktivieren diesen und machen ein banales alles markieren und kopieren.
Code: Select all
DetectHiddenWindows, On
ControlGetText, OutputVar, _WwG1, ahk_class rctrl_renwnd32
MsgBox % OutputVar
Code: Select all
ControlGetText, OutputVar, RichEdit20WPT4, ahk_class rctrl_renwnd32
Also den harten Weg. Wir kennen den Control. Aktivieren diesen und machen ein banales alles markieren und kopieren.
Code: Select all
ControlClick, _WwG1, ahk_class rctrl_renwnd32
Send, ^a
send, ^c
MsgBox % Clipboard
Re: Text aus Outlook kopieren?
Danke es funktioniert nur die letzte Lösung!
Re: Text aus Outlook kopieren?
noch ne möglichkeit
- Email vorher öffnen
- Email vorher öffnen
Code: Select all
ComObjError(false) ;disable COM error messages for some non available properties
m := ComObjActive("Outlook.Application")
try
olItem := m.ActiveWindow.CurrentItem
catch
olItem := m.ActiveExplorer.Selection.Item(1)
if (olItem.Class = 43)
olMailItem := olItem
else
{
MsgBox Es wurde keine Email gewählt
return
}
MyTextBetreffAlt := olMailItem.Subject
MyTextBodyAltHTML := olMailItem.HTMLBody
MyTextBodyAlt := olMailItem.Body
msgbox, HTML: `n%MyTextBodyAltHTML %
msgbox, Plantext: `n%MyTextBodyAlt%
return
-
- Posts: 264
- Joined: 09 Mar 2019, 01:52
- Location: Germany
- Contact:
Re: Text aus Outlook kopieren?
Über Com anstatt controls. Nice. Gute Idee.
Re: Text aus Outlook kopieren?
@ahk_fan beim start bekomme ich ein Fehlermeldung: da ist ein Leerzeichen zu viel
msgbox, HTML: `n%MyTextBodyAltHTML%
msgbox, HTML: `n%MyTextBodyAltHTML%
Re: Text aus Outlook kopieren?
@KHA das Kopieren ist der Feind des Denkens!
Hab schnell ne einen Bereich aus meinem Prog kopiert, umgeschrieben und zack! Fehler!
so ist es richtig:
Hab schnell ne einen Bereich aus meinem Prog kopiert, umgeschrieben und zack! Fehler!
so ist es richtig:
Code: Select all
ComObjError(false) ;disable COM error messages for some non available properties
m := ComObjActive("Outlook.Application")
try
olItem := m.ActiveWindow.CurrentItem
catch
olItem := m.ActiveExplorer.Selection.Item(1)
if (olItem.Class = 43)
olMailItem := olItem
else
{
MsgBox Es wurde keine Email gewählt
return
}
MyTextBetreffAlt := olMailItem.Subject
MyTextBodyAltHTML := olMailItem.HTMLBody
MyTextBodyAlt := olMailItem.Body
msgbox, HTML: `n%MyTextBodyAltHTML%
msgbox, Plantext: `n%MyTextBodyAlt%
return
Who is online
Users browsing this forum: No registered users and 37 guests