Outlook attachment size Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Trigg
Posts: 97
Joined: 07 Apr 2017, 19:43

Outlook attachment size

11 Oct 2017, 08:52

I am trying to figure out how to check an attachment's size without having to download it first. Is this possible with COM?

Thank you

Code: Select all

Attachments:
/*
Export all Attachments of a currently opened Outlook-Email to a folder
*/

!=::
export:

; ###### Exporting of Email in current Outlook-Inspector
oOutlook := ComObjActive("Outlook.Application")
oInspector := oOutlook.Application.ActiveInspector
Mail := oInspector.CurrentItem ; thats the current Emails Object


; Exporting Attachments
att_count:=mail.attachments.count
loop, %att_count%
	{
	att_filename:=mail.attachments(a_index).filename
	FileGetSize, OutputVar, %att_filename%, K
	MsgBox % OutputVar
	storepathname:="C:\Users\" . A_Username . "\Documents\" att_filename
	mail.attachments(a_index).saveasfile(storepathname)
	FileGetSize, OutputVar, %storepathname%, K
	MsgBox %storepathname% %OutputVar%
	If ( OutputVar > "20" )
		FileAppend, `n%att_filename%, C:\%Username%\Files\DoNotChange\TaskDescription.txt
	Else
		FileDelete, %storepathname%
	}
;https://autohotkey.com/boards/viewtopic.php?t=9159	Jovannb
return	
User avatar
Jovannb
Posts: 268
Joined: 17 Jun 2014, 02:44
Location: Austria

Re: Outlook attachment size

11 Oct 2017, 09:17

Hi,

there seems to be a property which contains an Outlook-attachments size

Source: https://www.add-in-express.com/creating ... ment-size/

but I'vent tried to code it in AHK

J.B.
AHK: 1.1.37.01 Ansi, 32-Bit; Win10 22H2 64 bit, german
Trigg
Posts: 97
Joined: 07 Apr 2017, 19:43

Re: Outlook attachment size

11 Oct 2017, 09:28

Jovannb wrote:Hi,

there seems to be a property which contains an Outlook-attachments size

Source: https://www.add-in-express.com/creating ... ment-size/

but I'vent tried to code it in AHK

J.B.
Thank you :)
Trigg
Posts: 97
Joined: 07 Apr 2017, 19:43

Re: Outlook attachment size  Topic is solved

11 Oct 2017, 10:41

Jovannb wrote:Hi,

there seems to be a property which contains an Outlook-attachments size

Source: https://www.add-in-express.com/creating ... ment-size/

but I'vent tried to code it in AHK

J.B.
So I figured out that this works. It's not a big deal, but I could only figure out how to get the size in bytes.

Code: Select all

size:=mail.attachments(a_index).size

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: TAC109 and 326 guests