This month we took a break from our “lectures” and just had a working session. Below are some of the code we reviewed
Thanks again to Jean Lalonde for walking us through his excellent efficiency tool Quick Access Popup
100 Words script
;https://ahdictionary.com/word/hundredsmart.html File_Path:="B:\Custom\Win\Desktop\100 Words to Make you sound smarter.txt" FileRead,Var,% File_Path ;~ Resizable_GUI(var,300,900) Loop,read, % File_Path aa++ ;increment rows- Need to know what the last row is so we can pick a Random number between 1 and it Random, Random_Row, 1, %aa% ;select random row ;~ Random, Random_Row, 1, 100 ;select random row between 1 and 100 FileReadLine, Word, % File_Path, Random_Row ;read the random row ;~ MsgBox % Word Run https://www.google.com/search?q=dictionary&oq=dictionary&ie=UTF-8#dobs=%Word% Clipboard:=Word ;Shove it into clipboard return
Check out the Outlook Webinar we did back in October of 2017
Moving emails from one folder to another
mail := ComObjActive("Outlook.Application").GetNameSpace("MAPI").GetDefaultFolder[6] ; Access the Session NameSpace ;~ mail := ComObjActive("Outlook.Application").GetNameSpace("MAPI").GetDefaultFolder[0] ; Access the Session NameSpace myDestFolder := mail.Folders("CCY") numb := myDestFolder.Items.Count MsgBox % numb Loop % mail.Items.Count { ; if Instr(mail.Items[A_Index].SenderName,"JoeTazz") { if Instr(mail.Items[A_Index].Subject,"commented on") { Item := mail.Items(A_Index) My .= A_Index "," } } StringTrimRight, My, My, 1 ; remove final `n Sort, My , N, R, D, ; Numeric sort ; MsgBox % My Loop, parse, My, `, mail.Items[A_LoopField].Move(myDestFolder) return
Saving Attachments from Selected Outlook Emails
Selection := ComObjActive("Outlook.Application").ActiveExplorer().Selection ;Connect to Outlook and store list of selected emails For a,b in Selection { ;Loop over selected emails oAtt:=selection.item(A_Index).Attachments ;For each email, create object storing the attachments for k, v in oAtt ;use For loop over attachments k.SaveAsFile("C:\temp\" . k.DisplayName) ;This will write the files to the C:\temp\ folder. Update for your needs. }