AutoHotkey Community

It is currently May 25th, 2012, 6:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: February 15th, 2005, 7:01 am 
Offline

Joined: February 11th, 2005, 6:31 am
Posts: 174
Location: Germany
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 :) ...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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2005, 1:06 pm 
Ein leeres/neues Mail läßt sich von der Kommandozeile aufrufen, damit entfällt die Bildschirmauflösungsabhängige Mausklickerei.
Check this out: [here]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2005, 6:36 am 
Offline

Joined: February 11th, 2005, 6:31 am
Posts: 174
Location: Germany
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 :?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2005, 7:41 am 
What about AHK's ControlGetText.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2005, 12:14 pm 
Offline

Joined: February 11th, 2005, 6:31 am
Posts: 174
Location: Germany
Hi Bobo, thx for your Hint. :D
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Outlook 2007
PostPosted: December 7th, 2011, 2:29 pm 
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?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group