Find string inside outlook .msg and inside archive .zip extensions

Get help with using AutoHotkey and its commands and hotkeys
blue83
Posts: 41
Joined: 11 Apr 2018, 06:38

Find string inside outlook .msg and inside archive .zip extensions

09 Jan 2019, 04:30

Hi,

Can anyone help and show me a way how to find a string inside outlook .msg and inside archive .zip.

My problem is that I have thousands of files with extension .msg and .zip, and is there any way to search through them fast?

In outlook .msg there are attachements like excel, pdf, word,.. and sometimes aren`t, just email body.

In archive .zip there are also various file types.

Blue83
blue83
Posts: 41
Joined: 11 Apr 2018, 06:38

Re: Find string inside outlook .msg and inside archive .zip extensions

11 Jan 2019, 08:26

Ok, I can manage with .zip, but .msg outlook is still a problem.

I have thousands of files saved in folder, but dont know how search through them and find what I want.

Can anyone help me?
hymal7
Posts: 66
Joined: 14 Sep 2016, 05:37

Re: Find string inside outlook .msg and inside archive .zip extensions

11 Jan 2019, 11:14

Code: Select all

try olApp := ComObjActive("Outlook.Application") ; Get the Outlook application object if Outlook is open
catch {
		olApp  := ComObjCreate("Outlook.Application") ; Create an Outlook application object if Outlook is not open
		CloseOutlook := true
	}
Loop, % A_Desktop "\*.msg"
{
	item := olApp.CreateItemFromTemplate(A_LoopFileFullPath)
	BodyMessage := item.Body
	Title := item.subject
	
	if instr(BodyMessage,"Mike")		;If there is "Mike" in the email body
	{
		msgbox %title%					;Do something: e.g. show the email title
	}
}
if (CloseOutlook)
    olApp.Quit

;#######################################################################
exitapp
esc::ExitApp
blue83
Posts: 41
Joined: 11 Apr 2018, 06:38

Re: Find string inside outlook .msg and inside archive .zip extensions

12 Jan 2019, 06:13

Thank you hymal7.

That is for body and excellent.

Do you know how to extract attachements into some folder?
Ahk_fan
Posts: 60
Joined: 31 Aug 2018, 14:34

Re: Find string inside outlook .msg and inside archive .zip extensions

12 Jan 2019, 09:18

Hi
try this:

Code: Select all

			
			att_count:=Item.attachments.count
			loop, %att_count%
			{
				try
				{
					att_filename:=Item.attachments(a_index).filename
					storepathname:= A_Scriptdir "\" att_filename
					Item.attachments(a_index).saveasfile(storepathname)
				}
				catch
				{
				MsgBox, 0, OUTLOOK-Export, ooopss...something was wrong...
				}
				
			}
regards,
AHK_fan :)
blue83
Posts: 41
Joined: 11 Apr 2018, 06:38

Re: Find string inside outlook .msg and inside archive .zip extensions

14 Jan 2019, 04:27

Wow thank you Ahk_fan.

This task is successfully solved.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bad husband, Bing [Bot], flyingDman, Google [Bot], nacken012 and 185 guests