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
Find string inside outlook .msg and inside archive .zip extensions
Re: Find string inside outlook .msg and inside archive .zip extensions
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?
I have thousands of files saved in folder, but dont know how search through them and find what I want.
Can anyone help me?
Re: Find string inside outlook .msg and inside archive .zip extensions
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
Re: Find string inside outlook .msg and inside archive .zip extensions
Thank you hymal7.
That is for body and excellent.
Do you know how to extract attachements into some folder?
That is for body and excellent.
Do you know how to extract attachements into some folder?
Re: Find string inside outlook .msg and inside archive .zip extensions
Hi
try this:
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...
}
}
Re: Find string inside outlook .msg and inside archive .zip extensions
Wow thank you Ahk_fan.
This task is successfully solved.
This task is successfully solved.
Who is online
Users browsing this forum: Google [Bot], moltenchees and 261 guests