Outlook wont open

Get help with using AutoHotkey and its commands and hotkeys
Posts: 149
Joined: 12 Apr 2018, 05:22
Location: Virginia Beach

Outlook wont open

18 Feb 2020, 11:53

here is my code. When you double click on the persons name in the list view, Outlook will NOT open. Well.....it opens on MY machine but will not open on 2 co-workers computers. Any ideas

Code: Select all

;;;;;;;;;;;;;;;;;;;;;;;; GUI creation
Gui 1: Add, Tab2,w400 h300, New Proj | Phonebook
Gui 1: Add, edit, w250 h20, Asia224 BonBon's New Lip
Gui 1: Add, Text,, Please enter your name:
Gui 1: Add, Button, w100 h20, Button1

Gui, Tab, 2
Gui 1: Add, edit, w213 h20, Shawn
Gui 1: Add, Button, w120 h20, Get Number
Gui 1: Add, Button, w120 h20, Open Phonebook
Gui, Add, Listview, r5 gDBLClick w330, Name_________|Phone|email

Gui 1: Show, x700 y120 h300 w400,
GUI, submit, nohide  
;;;;;;;;;;;;;;;;;;;;;;;;;; END GUI creation

;;;;;;;;;;;;;;;;;;;; OPEN PHONEBOOK BUTTON
run, %A_Desktop%\cbn phonebook.txt
SetTitleMatchMode, 2
WinWait,cbn phonebook.txt - Notepad,, 2,
WinGetActiveTitle, Title
WinMove,%Title%,   , 30,  30, 600, 900
;;;;;;;;;;;;;;;;;;;; END OPEN PHONEBOOK BUTTON

;;;;;;;;;;;;;;;;;;;;;; make GUI3, put double clicked row in GUI
if(a_guiEvent =="DoubleClick")
	;per the list view webpage 
	note := 
	RowNumber = 0     ;This causes the first loop iteration to start the search at the top of the list.
	    RowNumber := LV_GetNext(RowNumber)	;Resume the search at the row after that found by the previous iteration.
	    if not RowNumber     		;The above returned zero, so there are no more selected rows.
		columns := LV_GetCount("Column")
		note := 
		loop %columns%
			LV_GetText(Text, RowNumber, A_index)
			note .= Text . A_tab
			if columns = 3
			LV_GetText(the_email, RowNumber , 3)
			;msgbox 	%the_email%		

		;	LV_GetText(Text, RowNumber, A_index)
		;	note .= Text . A_tab
		stringtrimright note ,note,1			    
	    ;;MsgBox %note%  ;;;;;NOTE ALWAYS RETURNS [first last][number][email]

the_Subject = Hi From Emily Pruder
the_Body = 

email:=  the_email

m := ComObjCreate("Outlook.Application").CreateItem(0)
m.To := the_email
m.cc := 
m.Subject := the_Subject
m.Body := 
sleep 500
WinGetActiveTitle, OutputVar
;msgbox %OutputVar%
WinMove,  %OutputVar%,, 200,150,1000,700
sleep 500

Send, {Ctl}{PgDn}
click at 575, 150
Send {Down}
Send {Enter}

;;;;;;;;;;; code shawn added to diaplay a GUI with a text string
Gui, MyGui3: Show,  h180  w1200
guiControl, MyGui3:,DisplayText, %note%
;Gui, MyGui3: submit, nohide
;Gui, MyGui3: Font, s70
;Gui, MyGui3: Add, Text, x40 y60 , %note%
note :=  
;;;;;;;;;;;END code shawn added to diaplay a GUI with a text string

;;;;;;;;;;;;;;;;;;;;;; END make GUI3, put double clicked row in GUI

;3/3   set edit2 correctly
;;;;;;;;;;;;;;;;;; Get Number button
IfNotExist, C:\Users\%A_UserName%\Desktop\CBN phonebook.txt
;FileCreateDir,  C:\Users\%A_UserName%\Desktop\CBN phonebook.txt
FileAppend,shawn.steves 1234 [email protected]}
sleep 500

the_list = 

controlgettext, UserInput, edit2

the_loop_number = 1
Loop, read, C:\Users\%A_UserName%\Desktop\CBN phonebook.txt

	IfInString, A_LoopReadLine, %UserInput%
	the_list = %the_list%`r`n%A_LoopReadLine%  ;the return does not work, the next person is the next character NOT the next LINE
	StringSplit, word, A_LoopReadLine , %A_Space%
	LV_ADD("",word1 " " word2, word3, word4)
	;LV_ModifyCol()  ; Auto-size each column to fit its contents.


;;;;;;;;;;;;;;;;;; END 3/3 Get Number button

;ControlGetText, OutputVar , edit1 ; Control name shown by WindowSpy
;MsgBox %OutputVar%

Gui, 2: Add, Tab2,  w400 h300 ,
Gui, 2: Show, x900 y150 h300 w300,
Gui, 2: Add, Text,, Please enter your name:
;gui, font, s40, Verdana 



Return to “Ask For Help”

Who is online

Users browsing this forum: adrian88888888, aifritz, Albireo, Bing [Bot], HiSoKa, vsub, Yakshongas and 349 guests