Bin neuling bei AHK.
Habe insgesamt 3 edit boxen.
Aus diesen möchte ich die E-Mail, den Betreff und den E-Mail Texinhalt mit Variablen (Wie man im Code sieht) versuche auszulesen.
Leider funktioniert das nicht so wie ich es will.
Es funktioniert leider nur mit festen Werten, also z.B. m.Subject := "Betreff" aber ebend nicht mit den Werten aus den Edit Boxen.
Außerdem würde ich gerne, wenn ich einen Return mache in dere Edit Box, dass ich in der E-Mail auch einen Absatz habe, ist das möglich?
Code: Select all
global Betreff
global MText
global EMail
Gui, New, -MaximizeBox, Outlook Mail
Gui, Margin, 10, 10
Gui, Font, s12,
Gui, Add, Edit, x402 y59 w370 h190 +WantReturn vMText +Left,
Gui, Add, Text, x142 y29 w50 h20 Center, Betreff
Gui, Add, Edit, x22 y59 w320 h70 vBetreff,
Gui, Add, Text, x542 y29 w80 h20 +Center, E-Mail Text
Gui, Add, Button, x112 y219 w120 h30 + +Buttons, Fertig
Gui, Add, Text, x102 y139 w150 h20 , Ziel E-Mail Adresse
Gui, Add, Edit, x22 y169 w320 h30 vEMail
; Generated using SmartGUI Creator for SciTE
Gui, Show, w2054 h1451, Outlook Mail GUI
Gui, Show, AutoSize
Gui, Show, Center
return
ButtonFertig()
{
m := ComObjActive("Outlook.Application").CreateItem(0)
m.Subject := "Betreff"
m.To = %EMail%
m.Display
myInspector := m.GetInspector
wdDoc := myInspector.WordEditor
wdRange := wdDoc.Range(0, wdDoc.Characters.Count)
wdRange.InsertBefore(MText)
sleep, 200
GuiClose:
GuiEscape:
ExitApp
return true
}