AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Automate Adress for E-Mail/Automatische Anrede für E-Mail

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Andi



Joined: 11 Feb 2005
Posts: 173
Location: Germany

PostPosted: Tue Feb 15, 2005 6:01 am    Post subject: Automate Adress for E-Mail/Automatische Anrede für E-Mail Reply with quote

Here the idea how to automate the adress in an E-Mail Program
It works for the German Version of Outlook Express (1024x768)

Hier die Idee, wie man die Anrede in einem E-Mail Programm automatisieren kann

Nur was für faule Menschen Smile ...AHK ist einfach wundervoll!!!

Code:


;Schreibt in Outlook-Express (deutsche Version) automatisch die
;Anrede, indem aus der E-Mail Adresszeile der Nachname extrahiert wird.
;Hierzu gibt man im Body-Feld von Outlook einen der folgende Kürzel ein

;sh = Sehr geehrter Herr XXX,
;sf = Sehr geehrte Frau XXX,
;hh = Hallo Herr XXX,
;hf = Hallo Frau XXX,

::sh::
   {
   send, Sehr geehrter Herr{Space}
   gosub, Name_ermitteln
   return
   }
::sf::
   {
   send, Sehr geehrte Frau{Space}
   gosub, Name_ermitteln
   return
   }
::hf::
   {
   send, Hallo Frau{Space}
   gosub, Name_ermitteln
   return
   }
::hh::
   {
   send, Hallo Herr{Space}
   gosub, Name_ermitteln
   return
   }

Name_ermitteln:
WinWait, Neue Nachricht, 
IfWinNotActive, Neue Nachricht, , WinActivate, Neue Nachricht,
WinWaitActive, Neue Nachricht,
MouseClick, left,  86,  146 ;bei Bildschirmauflösung 1024 x 768 Mouseklick in die MailTo-Zeile (eventuell anpassen)
Send {CTRLDOWN}a{CTRLUP} ;gehe in die Zeile An:
Clipboard =  ; Clipboard löschen
Sleep, 100
Send, {CTRLDOWN}c{CTRLUP}{TAB}{TAB}{TAB}
ClipWait 0.5
EMail = %Clipboard%
StringSplit, Name, EMail, %A_Space%/.,@;_ ;Namenszeile in einzelne Bestandteile auflösen
StringTrimLeft, Nachname, Name2, 0 ;eventuell Variable Name1 nehmen, falls EMail Adressen im Format Nachname.Vorname organisiert sind
send %Nachname%,{Enter}{Enter}
return
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Feb 15, 2005 12:06 pm    Post subject: Reply with quote

Ein leeres/neues Mail läßt sich von der Kommandozeile aufrufen, damit entfällt die Bildschirmauflösungsabhängige Mausklickerei.
Check this out: [here]
Back to top
Andi



Joined: 11 Feb 2005
Posts: 173
Location: Germany

PostPosted: Fri Feb 18, 2005 5:36 am    Post subject: Reply with quote

Hi BoBo, der Mausklick dient nur dazu, den Cursor in dem MailTo Feld zu positionieren, um dann den markierten Inhalt per Strg+c zu kopieren. Das "Neue Nachricht"- Fenster ist ja schon geöffnet... oder habe ich Dich falsch verstanden?

Hast Du eventuell eine Idee, wie man den Inhalt des MailTo-Feldes direkt auslesen könnte Question
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Fri Feb 18, 2005 6:41 am    Post subject: Reply with quote

What about AHK's ControlGetText.
Back to top
Andi



Joined: 11 Feb 2005
Posts: 173
Location: Germany

PostPosted: Fri Feb 18, 2005 11:14 am    Post subject: Reply with quote

Hi Bobo, thx for your Hint. Very Happy
Now the script is a little shorter and more reliable and faster.

Code:

;Automatische Anrede / Automate Adress
;schreibt in der deutschen Version von Outlook-Express automatisch die Anrede in den E-Mail Body
;hierzu einfach im Body-Feld von Outlook einen der folgenden Kürzel eingeben:

;wrotes in the german Version of Outlook-Express the adress, if one of the
;following Hot-strings is typed. For the english Version you have to adapt the german lines:

;sh = Sehr geehrter Herr XXX
;sf = Sehr geehrte Frau XXX
;hh = Hallo Herr XXX
;hf = Hallo Frau XXX

:C:sh::
   {
   send, Sehr geehrter Herr{Space}
   gosub, AA_Name_ermitteln
   return
   }
:C:sf::
   {
   send, Sehr geehrte Frau{Space}
   gosub, AA_Name_ermitteln
   return
   }
:C:hf::
   {
   send, Hallo Frau{Space}
   gosub, AA_Name_ermitteln
   return
   }
:C:hh::
   {
   send, Hallo Herr{Space}
   gosub, AA_Name_ermitteln
   return
   }

AA_Name_ermitteln:
WinWait, Neue Nachricht, 
IfWinNotActive, Neue Nachricht, , WinActivate, Neue Nachricht,
WinWaitActive, Neue Nachricht,
ControlGetText, AA_Name, RichEdit20W2, Neue Nachricht ;holt sich aus dem Mail-To Feld den Namen
StringSplit, AA_Name, AA_Name, %A_Space%/.,@;_ ;Namenszeile in einzelne Bestandteile auflösen
StringTrimLeft, AA_Name, AA_Name2, 0 ;eventuell Variable AA_Name1 nehmen, falls EMail Adressen im Format Nachname.Vorname
send %AA_Name%,{Enter}{Enter}
return
Back to top
View user's profile Send private message
joohannes
Guest





PostPosted: Wed Dec 07, 2011 1:29 pm    Post subject: Outlook 2007 Reply with quote

i tried to apply this to Outlook 2007, but it just inserts "Hallo Herr" without the name.

Any idea, how this could be migrated to work with Outlook 2007?
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group