Macto to strip attachments from email

R

Rob F

Hi

One of the repetitive tasks I have to do at work is to
review my emails, delete attachments that I no longer
need / have saved elsewhere, and annotate the email
with "<< file(s) removed >>".

(My emails use Rules to go into a number of sub-folders of
Inbox.)

What I'd really love is a macro that would act on the
highlighted (active?) email(s), and do the above task
automatically.

Is this possible at all?

Regards,

Rob F
 
R

Rob F

Thanks for the quick response, Sue.

The Outlookcode macro works fine.

When I run the Slovaktech one I get an error
message "Compile Error. User-defined type not defined"
which highlights the line Dim fso As
Scripting.FileSystemObject in the associated Function.

How would I tweak the scripts to get the macro to insert
the words "file removed" in the stripped emails?

Rob F
 
S

Sue Mosher [MVP-Outlook]

You must either add a reference to the Microsoft Scripting Runtime or Dim
that object as Object.

You can insert text by appending to the Body or, for an HTML-format message,
to the HTMLBody property of the MailItem object. Appending to Body may
change the message format, depending on your version of Outlook and
appending to HTMLBody means that you need to use HTML tags.
 
R

Rob F

How would I tweak the scripts to get the macro to insert
the words "file removed" in the stripped emails?

Silly me - just realised the Outlookcode one does what I
want!

However, in inserting the 'removed attachments' text, the
whole of my email is reformatted to 10pt Arial blue. E.g.
the From/Sent/To/Subject bit, which is normally in 8pt
black Tahoma is changed, plus the whole of an email text
is changed from the format it was received in, to the 10pt
Arial blue.

Can this quirk be removed, I wonder?!

Rob F
 
S

Sue Mosher [MVP-Outlook]

Please read my other response.

Rob F said:
Silly me - just realised the Outlookcode one does what I
want!

However, in inserting the 'removed attachments' text, the
whole of my email is reformatted to 10pt Arial blue. E.g.
the From/Sent/To/Subject bit, which is normally in 8pt
black Tahoma is changed, plus the whole of an email text
is changed from the format it was received in, to the 10pt
Arial blue.

Can this quirk be removed, I wonder?!

Rob F
 
R

Rob F

You can insert text by appending to the Body or, for an
HTML-format message,
to the HTMLBody property of the MailItem object. Appending to Body may
change the message format, depending on your version of Outlook and
appending to HTMLBody means that you need to use HTML
tags.

Most of the emails in my company are in Rich Text Format.

Rob F
 
R

Rob F

-----Original Message-----
Then you have rather a long road ahead, because there's no direct way to set
RTF -- see http://www.outlookcode.com/d/formatmsg.htm

Sue

I said RTF but what I really meant was "Microsoft Outlook
Rich Text". I'm hoping that's different, and there is a
way of retaining that formatting when the "Removed
Attachment" text is added.

Sorry for not being specific enough!

Rob F
 
S

Sue Mosher [MVP-Outlook]

RTF = rich text format. The page I suggested describes the available
techniques -- CDO, and Redemption.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Ken Slovak - [MVP - Outlook]

You need to reference Windows Scripting runtime in your VBA project
(Scrrun.dll). If you do that does that error go away?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top