Attachment file size checker

Status
Not open for further replies.
J

Jazsnap

Hi,

I'm trying to find a way to display a warning box when users attempt to

send attachments above a certain size. I have found some VBA code to

achieve this from here:

http://www.vboffice.net/en/developers/check-email-size-before-sending

I can't, however, get it to work, I think this is because we are using

Outlook 2002 (SP3) and this code is incompatible with that version.

After some testing I've found that the line of code:

lSize = oMail.Size

always returns a value of zero. Can anyone point me in the right direction

to amend this code so it works how I want it to. I've not programmed in VB

for years so apologies in advance if this is obvious.

Thanks, Jason
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Call oMail.save first, then you can retrieve the Size property.

Best regards

Michael Bauer

Am Wed, 20 May 2009 02:09:07 -0700 schrieb Jazsnap:


> Hi,

> I'm trying to find a way to display a warning box when users attempt to
> send attachments above a certain size. I have found some VBA code to
> achieve this from here:

> http://www.vboffice.net/en/developers/check-email-size-before-sending

> I can't, however, get it to work, I think this is because we are using
> Outlook 2002 (SP3) and this code is incompatible with that version.

> After some testing I've found that the line of code:

> lSize = oMail.Size

> always returns a value of zero. Can anyone point me in the right direction
> to amend this code so it works how I want it to. I've not programmed in VB
> for years so apologies in advance if this is obvious.

> Thanks, Jason
 
J

Jazsnap

"Michael Bauer " <mb@mvps.org> wrote in news:g12yzbxfizy9

$.q3ew9snab5xa$.dlg@40tude.net:



> Call oMail.save first, then you can retrieve the Size property.
>


Thanks for that, I have the script working now. Really appreciate your

help.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M reducing file attachment size on custom form Using Outlook 0
P File Picker for attachment Outlook VBA and Custom Forms 0
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
N File Picker for attachment Outlook VBA and Custom Forms 2
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
S save attachment with date & time mentioned inside the file Outlook VBA and Custom Forms 0
F Script for zip file attachment Outlook VBA and Custom Forms 1
geofferyh How to change the Attachment File Name? Outlook VBA and Custom Forms 1
N Paste content to Excel when .txt file (attachment) is opened Outlook VBA and Custom Forms 1
P Outlook Randomly Not attaching (attachment file) Using Outlook 0
RalphG101 No indication of attachment, when selecting file, send to outlook. Using Outlook 0
A "untitled attachment" if file name contains eg. special character Using Outlook 1
L Outgoing Email attachment error "the system cannot find the file specified" Using Outlook 3
D Outlook File Attachment Based on Contact Name Outlook VBA and Custom Forms 5
? outlook attachment Extract File ??? Outlook VBA and Custom Forms 1
E Auto Save Zip File Attachment to Network Folder Outlook VBA and Custom Forms 1
3 Outlook 2007 and file attachment conversion Outlook VBA and Custom Forms 3
kkqq1122 How would I add Search for attachment name Outlook VBA and Custom Forms 3
Owl Export Outlook PDF Attachment as JPG? Outlook VBA and Custom Forms 3
Timmon Remove just one attachment before AutoForward Outlook VBA and Custom Forms 0
G print attachment straight away; working script edit not working Outlook VBA and Custom Forms 0
G Save attachment run a script rule Outlook VBA and Custom Forms 0
M Autoforward just attachment OR just body. Outlook VBA and Custom Forms 0
D Create new email from the received Email Body with attachment Outlook VBA and Custom Forms 10
K Outlook Office 365 VBA download attachment Outlook VBA and Custom Forms 2
P Sending email from outlook IMAP to GMAIL where embedded images are added as attachment Using Outlook 1
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
A Edit attachment Save and Reply Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
B Outlook 2010 Opening Mail Attachment Using Outlook 2
A Warning When Opening attachment Using Outlook 7
R Limiting length of saved attachment in VBA Outlook VBA and Custom Forms 2
P Outlook 2013 Word Share doc as Email Attachment now brings up Eudora. Using Outlook 1
L Attachment saving and tracking - PLEASE help! Outlook VBA and Custom Forms 5
H Outlook 2003 find by "has attachment" Using Outlook 1
9 Outlook 2016 How to save an Outlook attachment to a specific folder then delete the email it came from? Using Outlook 1
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
geofferyh Cannot get Macro to SAVE more than one message attachment??? Outlook VBA and Custom Forms 5
geofferyh Outlook 2010 How to Copy Outlook Attachment to a Specific Folder? Outlook VBA and Custom Forms 3
D Body text of email disappears when I scan an attachment from printer to email Using Outlook 1
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
W Save Outlook attachment in network folder and rename to current date and time Outlook VBA and Custom Forms 18
D Autosave Attachment and Rename Outlook VBA and Custom Forms 1
N Macro for attachment saved and combine Outlook VBA and Custom Forms 1
Andrew Quirl Open attachment, manipulate without add-on program? Outlook VBA and Custom Forms 5
V VB script code to save a specific email attachment from a given email Outlook VBA and Custom Forms 14
Commodore Attachment icon when there is no attachment Using Outlook 3
V Saving attachment from outlook in My Documents Outlook VBA and Custom Forms 14
N automatic response with an attachment based on the subject line Outlook VBA and Custom Forms 1
J Auto Forward - Include Attachment and change Subject depending on original sender Outlook VBA and Custom Forms 3

Similar threads

Top