Problem bei Verwendung von Edit-Boxen

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Problem bei Verwendung von Edit-Boxen

Re: Problem bei Verwendung von Edit-Boxen

Post by gregster » 19 Jul 2019, 07:20

Willommen im Forum!

So müsst's gehen:

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, 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()
{
	Gui, Submit

	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
}
Gui, Submit braucht es auf jeden Fall, um die Variablen auslesen/verwenden zu können. Ein schneller Test deutet darauf hin, dass Zeilenumbrüche korrekt aus dem Edit-Feld in die Email übernommen werden (Outlook 2013)...?!

Problem bei Verwendung von Edit-Boxen

Post by mheuer » 19 Jul 2019, 05:08

Moin, könnte mir jeman helfen?
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
	
}
[Mod edit: [code][/code] tags and topic name added]

Top